n = int(eval(input()))

m = n

sum = 0





for i in range(n):

    sum = m % 10 + sum

    m = m//10



if sum == 1:

    print((10))

else:

    print(sum)
n = int(eval(input()))

sum = 0



for i in str(n):

    sum += int(i)

if sum == 1:

    sum += 9

print(sum)
n = int(eval(input()))
m = n
sum = 0
for i in range(n):
    sum = m % 10 + sum
    m = m // 10
if sum == 1:
    print((10))
else:
    print(sum)

n = int(eval(input()))
sum = 0
for i in str(n):
    sum += int(i)
if sum == 1:
    sum += 9
print(sum)

-m = n -for i in range(n): -    sum = m % 10 + sum -    m = m // 10 +for i in str(n): +    sum += int(i) -    print((10)) -else: -    print(sum) +    sum += 9 +print(sum)