A magic island Geraldion, where Gerald lives, has its own currency system. It uses banknotes of several values. But the problem is, the system is not perfect and sometimes it happens that Geraldionians cannot express a certain sum of money with any set of banknotes. Of course, they can use any number of banknotes of each value. Such sum is called unfortunate. Gerald wondered: what is the minimum unfortunate sum?
The first line contains number *n* (1 ≤ *n* ≤ 1000) — the number of values of the banknotes that used in Geraldion. 

The second line contains *n* distinct space-separated numbers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">6</sup>) — the values of the banknotes.
# Input
n = int(input())
banknotes = list(map(int, input().split()))

# Sort the banknote values
banknotes.sort()

# Initialize the minimum unfortunate sum as -1 (no unfortunate sum found yet)
minimum_unfortunate_sum = -1

# Iterate through the banknote values
for i in range(n):
    # If the current banknote value is greater than the current minimum unfortunate sum + 1,
    # set the minimum unfortunate sum to the current minimum unfortunate sum + 1
    if banknotes[i] > minimum_unfortunate_sum + 1:
        minimum_unfortunate_sum = minimum_unfortunate_sum + 1
        break

    # If not, update the minimum unfortunate sum to the current banknote value
    minimum_unfortunate_sum = banknotes[i]

# Print the minimum unfortunate sum
print(minimum_unfortunate_sum)


 		 	  	  	      	 			   					