function Main(input) {
	var n  = input.match(/^10+/)
	if(n!==null) console.log(10);
	else console.log(input[0]-0+(arrsum(input.slice(1,input.length).split("").map(Number))-0));
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
function arrsum(arr){
    var sum = 0;
    for (var i=0,len=arr.length; i<len; ++i) {
        sum += arr[i];
    }
    return sum;
}