function Main(input){
	var xs = input.trim().split('').map(v=>parseInt(v,10));
	var ans = 0;
    for(var i =0; i<xs.length; i++){
    	if(xs[i] == 1){
    	ans = ans+1;
    	}else{
    	ans = ans+0;
    	}
    }
    console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin","utf8"));