process.stdin.resume();
process.stdin.setEncoding('utf8');
 
var lines = [];
var reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});
reader.on('line', (line) => {
    // ここで入力を処理する
    lines.push(line);
});
reader.on('close', () => {
  var a = lines[0].split("");
  var cnt = 0;
 // console.log(a)
  for(var i in a){
    if(a[i] == 1){
      //console.log(a[i])
    ++cnt}
  }
  console.log(cnt)

//console.log(1*lines[0]+1*lines[1].split(' ')[0]+1*lines[1].split(' ')[1]+" "+lines[2])
});