import math a=1000000000 b=(int(input())-7) if a>b: print(math.floor(math.log10(a/b))) else: print(math.floor(math.log10(b/a)))