N=eval(input())

import re

if re.match('10+',N):

    print((10))

else:

    ans=0

    for n in N:

        ans+=int(n)

    print(ans)
N=eval(input())

ans=0

for n in N:

    ans+=int(n)

if ans==1:

    ans=10

print(ans)
N = eval(input())
import re

if re.match("10+", N):
    print((10))
else:
    ans = 0
    for n in N:
        ans += int(n)
    print(ans)

N = eval(input())
ans = 0
for n in N:
    ans += int(n)
if ans == 1:
    ans = 10
print(ans)

-import re - -if re.match("10+", N): -    print((10)) -else: -    ans = 0 -    for n in N: -        ans += int(n) -    print(ans) +ans = 0 +for n in N: +    ans += int(n) +if ans == 1: +    ans = 10 +print(ans)