a = int(eval(input()))

cnt = 0

  

while a != 0:

  if a%10 == 1:

  	cnt += 1

  a = int(a/10)

  

print(cnt)
a = eval(input())

cnt = 0

if a[0] == '1':

  cnt += 1

if a[1] == '1':

  cnt += 1

if a[2] == '1':

  cnt += 1

  

print(cnt)
a = int(eval(input()))
cnt = 0
while a != 0:
    if a % 10 == 1:
        cnt += 1
    a = int(a / 10)
print(cnt)

a = eval(input())
cnt = 0
if a[0] == "1":
    cnt += 1
if a[1] == "1":
    cnt += 1
if a[2] == "1":
    cnt += 1
print(cnt)

-a = int(eval(input())) +a = eval(input()) -while a != 0: -    if a % 10 == 1: -        cnt += 1 -    a = int(a / 10) +if a[0] == "1": +    cnt += 1 +if a[1] == "1": +    cnt += 1 +if a[2] == "1": +    cnt += 1