s=eval(input())

count=0

if(s[0]=='1'):

  count+=1

if(s[1]=='1'):

  count+=1

if(s[2]=='1'):

  count+=1

print(count)

s = eval(input())

count=0

for _ in s:

  if ( _ == '1'):

    count+=1

print(count)

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

s = eval(input())
count = 0
for _ in s:
    if _ == "1":
        count += 1
print(count)

-if s[0] == "1": -    count += 1 -if s[1] == "1": -    count += 1 -if s[2] == "1": -    count += 1 +for _ in s: +    if _ == "1": +        count += 1