/* x x x x x */
//var input = "1 1 0 1 1";

function main(input){
  input = input.trim();
  var list = input.split(" ");
  for(var i=0; i<list.length; i++){
    if(list[i]==0){console.log(i+1);}
  }
}
//main(input);
main(require("fs").readFileSync("/dev/stdin", "utf8"));