var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
var counter = function(str,seq){
    return str.split(seq).length - 1;
}
reader.on('line', function(line) {
  lines.push(line);
});
reader.on('close', function() {
    console.log(counter(lines[0], /1/));
});