Problems
Permutation
Permutation
The sequence of n positive integers is given. Determines whether the sequence is a permutation of the first n positive integers.
Input
One line specifies the number n (n ≤ 10000) and n positive integers separated by space. It is known that each positive integer is less than 2000000.
Output
Print 0, if the sequence is a permutation. Otherwise print the minimum number that is not in the sequence.
Input example #1
3 2 1 3
Output example #1
0
Input example #2
3 1 4 2
Output example #2
3