"use strict";

function main(input) {
  input = input.trim().split(" ");
  let ans;
  for (let i in input) {
    if (parseInt(input[i]) === 0) {
      ans = parseInt(i) + 1;
    }
  }
  console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf-8"));
