function main(input) {
  const x = input[0].trim().split(" ").map(i => parseInt(i));

  let index = 0;
  for(let i of x){
    index++;
    if(i===0){
      console.log(index);
    }
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"));