

function main(input) {
  let args = input.split('\n');
  let x = 0;
  let a = args[x++].split(' ');
  for (let i = 0; i < a.length; ++i) {
    if (+a[i] == 0) {
      console.log(i + 1);
      return;
    }
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
