-- editorial
qsum = sum.map(read.pure).show

main = do
    n <- readLn :: IO Int
    let r = if is10pow (show n)
        then 10
        else qsum n
    print r

is10pow ('1':xs) = all (=='0') xs
is10pow _ = False