n = sum(map(int, eval(input())))

print((10 if n == 1 else n))
s = sum(map(int, list(eval(input()))))

print((10 if s == 1 else s))
n = sum(map(int, eval(input())))
print((10 if n == 1 else n))

s = sum(map(int, list(eval(input()))))
print((10 if s == 1 else s))

-n = sum(map(int, eval(input()))) -print((10 if n == 1 else n)) +s = sum(map(int, list(eval(input())))) +print((10 if s == 1 else s))