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