C = input() ans = len(C) - C.count('0') - 1 print(ans)