Snuke has a grid consisting of three squares numbered 1, 2 and 3. In each square, either `0` or `1` is written. The number written in Square i is s_i.  Snuke will place a marble on each square that says `1`. Find the number of squares on which Snuke will place a marble.
s = input()
s1 = int(s[0])
s2 = int(s[1])
s3 = int(s[2])
ans = 0
if s1 == 1:
    ans += 1
elif s2 ==1:
    ans += 1
elif s3 == 1:
    ans += 1
print(ans)
s = input()
s1 = int(s[0])
s2 = int(s[1])
s3 = int(s[2])
ans = s1+s2+s3
print(ans)