function main(lines) {
  const input = lines.split(' ')
  let count = 0;
  for(let i=0; i<input.length; i++){
      count++
      if(input[i] == 0){
          break;
      }
  }
  console.log(count)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

