import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) c = readline().rstrip().decode() ans = -1 for cc in c: if cc != '0': ans += 1 print(ans)