N = input() print(abs(len(N) - len('1000000007')))