local someTable = {}
for i=1,10 do
    someTable[10^i] = true
end

function suibian(a)
    local total = 0
    if someTable[a] then
        print(10)
        return
    end
    a = tostring(a)
    for i=1,string.len(a) do
        total = tonumber(string.sub(a,i,i))+total
    end
    print(total)
end
local n = io.read("*n")
suibian(n)