C = input() ans = 0 for c in C: if c != "0": ans += 1 print(ans-1)