'use strict'
function main(input) {
  input = input.trim()
  if (input.match(/^10+$/)) {
    console.log(10)
  } else {
    console.log(input.split('').reduce((r, c) => Number(r) + Number(c), 0))
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
