broj = int(input()) jed = broj % 10 des = (broj // 10) % 10 sto = broj // 100 najmanja_cifra = min(jed, des, sto) print(najmanja_cifra)