def digit(a):

    tmp = list(str(a))

    x = 0

    for j in tmp:

        x += int(j)

    return x

n=int(eval(input()))

min_ = n

for i in range(1,n//2):

    y = digit(i)+digit(n-i)

    min_ = min(min_,y)

print(min_)
n=list(eval(input()))

a=0

for i in n:a+=int(i)

print((10 if a==1 else a))

def digit(a):
    tmp = list(str(a))
    x = 0
    for j in tmp:
        x += int(j)
    return x


n = int(eval(input()))
min_ = n
for i in range(1, n // 2):
    y = digit(i) + digit(n - i)
    min_ = min(min_, y)
print(min_)

n = list(eval(input()))
a = 0
for i in n:
    a += int(i)
print((10 if a == 1 else a))

-def digit(a): -    tmp = list(str(a)) -    x = 0 -    for j in tmp: -        x += int(j) -    return x - - -n = int(eval(input())) -min_ = n -for i in range(1, n // 2): -    y = digit(i) + digit(n - i) -    min_ = min(min_, y) -print(min_) +n = list(eval(input())) +a = 0 +for i in n: +    a += int(i) +print((10 if a == 1 else a))