main :: IO ()
main = do
  n <- readLn
  print $ solve n

solve :: Int -> Int
solve n
  | n `elem` [ 10 ^ p | p <- [1..5] ] = 10
  | otherwise = digitSum n

digitSum :: Int -> Int
digitSum n
  | q == 0 = r
  | otherwise = r + digitSum q
  where (q, r) = n `divMod` 10