function main(input) { const n = Number(input[0]); const bit = input[1].split(" "); let ans = 0; for(let i=0; i= n) { j = n; break; } if(bit[j+1] === "1") { j+=1; break; } j+=2; } return j-i; } main(require("fs").readFileSync("/dev/stdin", "utf8").split("\n"));