C = input() ans = 0 for s in C: if s == '0': continue ans += 1 print (ans-1)