"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const A = arg[0].split(" ").map(n=>parseInt(n));
    

    console.log(A.indexOf(0) + 1);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));