const main = (input) => {
  const args = input.trim().split(" ");
  args.map((n, i)=>{
    if(n === "0"){
      console.log(i + 1);
    }
  })
};

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