s = input() print(abs(len(s)-len("1000000007")))