function main(arg) {
  count = 0;
  var items = arg.trim().split("").forEach(item => {
    if(item === "1"){
      count++;
    }
  });
  console.log(count);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));