N = input() count = 0 for i in range(len(N)): if N[i] == '0': count += 1 if count != 8: print(abs(count - 8))