n = int(input()) n -= 7 if n > 1000000000: n //= 1000000000 else: n = 1000000000 // n k = 0 while n > 1: k+=1 n //= 10 print(k)