const chunks = [];
process.stdin.on("data", (chunk) => {
  chunks.push(chunk);
});
process.stdin.on("end", () => {
  const data = Buffer.concat(chunks).toString("utf8");
  const variables = data
    .trim()
    .split(" ")
    .map((s) => parseInt(s, 10));
  console.log(solve(variables));
});

function solve(variables) {
  for (let i = 0; i < variables.length; i++) {
    if (variables[i] === 0) return i + 1;
  }
  return variables.length;
}
