N = int(input()) d = 10 while True: if (d - 1) ** 2 >= N: print(len(str(d)) - 1) break d *= 10