function Main(s){
  var n = +s;
  var ans = 0;
  while(n){
    ans += n % 10;
    n = Math.floor(n / 10);
  }
  if(ans === 1)ans = 10;
  console.log(ans);
}

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