"use strict";

const main = (arg) => {
  const input = arg.trim().split("\n")[0];
  const numbers = input.split(" ");
  for (let i = 0; i < numbers.length; i++) {
    if (parseInt(numbers[i]) === 0) return console.log(i + 1);
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));  
