import Foundation

let N = Int(readLine()!)!
var answer = 0
var lengthOfN = 0

if N % 10 == 0 {
  answer = 10
} else {
  var tN = N
  while tN != 0 {
    tN /= 10
    lengthOfN += 1
  }
  tN = N
  var i = lengthOfN, j: Int
  while i > 0 {
    i -= 1
    j = Int(pow(10.0, Double(i)))
    answer += tN / j
    tN %= j
  }
}

print(answer)