N = input() count = 0 for i in N: if i == '0': count += 1 print(abs(count-8))