import re

a = eval(input())

regex = '^(\d)(\d)(\d)'

s1 = int(re.sub(regex, r'\1', a))

s2 = int(re.sub(regex, r'\2', a))

s3 = int(re.sub(regex, r'\3', a))

i = 0

if s1 == 1:

    i += 1

if s2 == 1:

    i += 1

if s3 == 1:

    i += 1

print(i)
d = list(eval(input()))

i = 0

if d[0] == '1': i += 1

if d[1] == '1': i += 1

if d[2] == '1': i += 1

print(i)
import re

a = eval(input())
regex = "^(\d)(\d)(\d)"
s1 = int(re.sub(regex, r"\1", a))
s2 = int(re.sub(regex, r"\2", a))
s3 = int(re.sub(regex, r"\3", a))
i = 0
if s1 == 1:
    i += 1
if s2 == 1:
    i += 1
if s3 == 1:
    i += 1
print(i)

d = list(eval(input()))
i = 0
if d[0] == "1":
    i += 1
if d[1] == "1":
    i += 1
if d[2] == "1":
    i += 1
print(i)

-import re - -a = eval(input()) -regex = "^(\d)(\d)(\d)" -s1 = int(re.sub(regex, r"\1", a)) -s2 = int(re.sub(regex, r"\2", a)) -s3 = int(re.sub(regex, r"\3", a)) +d = list(eval(input())) -if s1 == 1: +if d[0] == "1": -if s2 == 1: +if d[1] == "1": -if s3 == 1: +if d[2] == "1":