sumOfDigitp :: Int -> Int -> Int
sumOfDigitp total 0 = total
sumOfDigitp total n = sumOfDigitp (total + r) q
  where
    q = n `div` 10
    r = n `mod` 10

sumOfDigit :: Int -> Int
sumOfDigit = sumOfDigitp 0

func :: Int -> Int
func n = case np of
  1 -> 10
  otherwise -> np
  where
    np = sumOfDigit n

main = do
  line <- getLine
  let
    n = read line :: Int
    ans = func n
  putStrLn $ show ans
