l = len(input()) a = len("1000000007") print(abs(l - a))