import sys



stdin = sys.stdin



ni = lambda: int(ns())

na = lambda: list(map(int, stdin.readline().split()))

ns = lambda: stdin.readline()



s = ns()

ans = 0

for i in s:

    if i == '1':

        ans += 1

    else:

        pass

print(ans)

import sys



stdin = sys.stdin



ni = lambda: int(ns())

na = lambda: list(map(int, stdin.readline().split()))

ns = lambda: stdin.readline()



s = ns()

ans = 0

if s[0] == '1':

    ans += 1

if s[1] == '1':

    ans += 1

if s[2] == '1':

    ans += 1

print(ans)

import sys

stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()
s = ns()
ans = 0
for i in s:
    if i == "1":
        ans += 1
    else:
        pass
print(ans)

import sys

stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()
s = ns()
ans = 0
if s[0] == "1":
    ans += 1
if s[1] == "1":
    ans += 1
if s[2] == "1":
    ans += 1
print(ans)

-for i in s: -    if i == "1": -        ans += 1 -    else: -        pass +if s[0] == "1": +    ans += 1 +if s[1] == "1": +    ans += 1 +if s[2] == "1": +    ans += 1