
function main(input) {
    let x = input.trim().split(/[\s\n]/).map(Number)
    const result = x.findIndex(n => n === 0) + 1
    console.log(result)
}

main(require("fs").readFileSync("/dev/stdin", "utf8"))
