function Main(input) {
	var sum = 0;
	var inp = input.split("");
    inp.pop();
    inp.map( x => parseInt(x, 10) ).forEach( x => ( sum += x ) );
	console.log('%d',sum);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));