a = eval(input())

count = 0

if a[0] == "1":

  count += 1

if a[1] == "1":

  count += 1

if a[2] == "1":

  count += 1

print(count)
a = eval(input())

count = 0

for b in a:

  if b == "1":

    count += 1





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

a = eval(input())
count = 0
for b in a:
    if b == "1":
        count += 1
print(count)

-if a[0] == "1": -    count += 1 -if a[1] == "1": -    count += 1 -if a[2] == "1": -    count += 1 +for b in a: +    if b == "1": +        count += 1