function Main(input){
  input = input.split("\n");
  tmp = input[0]
  
  var searchResult = tmp.match(/1/gi);
  if(searchResult){
  console.log(searchResult.length);
  }else{
    console.log("0");
  }
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));