Minimum Excluded value (MEX)

Let’s consider the positive whole numbers (0, 1, 2, …). For a given list of numbers l, we’ll say that the minimum excluded value (MEX) of l is the smallest nonnegative integer number that doesn’t occur in l. You are asked to write a program that given the list l, would calculate its MEX.

Input

The first line of the input contains a single integer n (1 ≀ n ≀ ) the number of elements in the list l. The next line contains n elements representing the list .

Output

The program should print the MEX of the given list.

Examples

Input
Output
3 1 2 3
0
4 0 1 3 4
2
5 0 1 2 3 4
5
Β 

Constraints

Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue