function Main(input) {
  var n = parseInt(input.split("\n")[0], 10);
  if (n === 10 || n === 100 || n === 1000 || n === 10000 || n === 100000) {
    console.log(10);
    return;
  } else {
    var sum = 0;
    while(n > 0) {
      sum += n % 10;
      n = Math.floor(n / 10);
    }
    console.log(sum);
    return;
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));