'use strict'


const main = (arg) => {
    const nums = arg.split(" ");
    nums.forEach((num,index) => {
        if(num==0) console.log(index+1);
    });
}

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