I=eval(input())

I2=list(map(int, I))

X=sum(I2)

print(X)
a=input().count("1")

print(a)

I = eval(input())
I2 = list(map(int, I))
X = sum(I2)
print(X)

a = input().count("1")
print(a)

-I = eval(input()) -I2 = list(map(int, I)) -X = sum(I2) -print(X) +a = input().count("1") +print(a)