Under construction

Still being built. Things may change

Duplicated number

Time limit2sMemory limit256 MB

Summary
A size-N array contains 1..N-1 with one value M repeated; find M.
Level

Easy3 of 10

Topics
Math
Solved
No attempts yet

Problem

A sequence holds every integer from 11 to N−1N-1 exactly once, in no particular order. One more integer MM with 1≤M≤N−11 \le M \le N-1 is put into it, which makes a sequence AA of size NN. Given AA, write a program that finds MM.

Input

The first line contains the size NN of the sequence AA (2≤N≤10 000 0002 \le N \le 10\,000\,000).

The second line contains the NN elements of AA, separated by spaces. Every element is an integer between 11 and N−1N-1, and all of them are distinct except the answer MM.

Output

Print MM on the first line.

Examples5

  1. Example 1

    Input
    10
    1 2 2 5 6 4 3 7 8 9
    
    Expected output
    2
    
  2. Example 2

    Input
    2
    1 1
    
    Expected output
    1
    
  3. Example 3

    Input
    3
    1 1 2
    
    Expected output
    1
    
  4. Example 4

    Input
    5
    4 1 3 2 4
    
    Expected output
    4
    
  5. Example 5

    Input
    7
    3 6 1 5 3 2 4
    
    Expected output
    3