const Main = input => {
    input = input.trim();
    input = input.split(" ").map(value => parseInt(value, 10));

    let result;
    for(let i = 0; i < input.length; i++) {
        if(input[i] !== i + 1) {
            result = i + 1;
            break;
        }
    }
    console.log(result);
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));