n = int(eval(input()))



print((10 if n in [10 ** x for x in range(6)] else sum(map(int,str(n)))))

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

print((10 if n==1 else n))
n = int(eval(input()))
print((10 if n in [10**x for x in range(6)] else sum(map(int, str(n)))))

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

-n = int(eval(input())) -print((10 if n in [10**x for x in range(6)] else sum(map(int, str(n))))) +n = sum(map(int, eval(input()))) +print((10 if n == 1 else n))