function Main(input) {
	var a = 0;
    input = input.split("\n");
	a = parseInt(input[0], 10);
	var a1 = Math.floor(a/100);
	a = a%100;
	var a2 = Math.floor(a/100);
	a = a%10;
	var a3 = Math.floor(a);
	console.log(a1+a2+a3);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));