"use strict"
function main(arg) {
    let base = [1,2,3,4,5]
    let list = arg.trim().split("\n")[0].split(" ").map(Number)
    for (let i = 0; i < list.length; i++) {
        if (base[i] !== list[i]) {
            console.log(i + 1)
            break
        }
    }
    // console.log()
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));