Under construction

Still being built. Things may change

Concert

Interview

Time limit1sMemory limit512 MB

Summary
Given up to one million first-round ticket numbers, find the smallest positive integer not among them.
Level

Easy3 of 10

Topics
Sorting, Implementation
Solved
No attempts yet

Problem

HCPC (Hanyang Completely Perfect Celebrity) is the title given to the best singer at Hanyang University. Hanyang University selects the best HCPC every year. Becoming an HCPC is far from easy. Every morning they peel and swallow a raw egg, wear a scarf even in summer to protect their throat, and usually do not speak a single word, all to take care of their throat. It is said that even a person with dull, hard-of-hearing ears becomes sharp-eared, clear-headed, and wise, and realizes the truths of life, after hearing just one phrase of an HCPC's song.

To give Hanyang students a chance to hear the voice of such an HCPC, Hanyang University holds an HCPC concert every year. Ticketing for the HCPC concert is fiercely competitive, and ticketing takes place in two rounds. The smaller the ticket number, the closer you can hear the HCPC's voice.

Yanghani missed the first round of ticketing for the HCPC concert and challenges the second round. Yanghani obtained very special information: the list of ticket numbers already sold in the first round of ticketing. Ticket numbers start from 1.

Yanghani wants to know the smallest ticket number among the tickets excluding those with numbers in this list. Help Yanghani!

Input

The first line gives an integer NN, the number of tickets sold in the first round of ticketing. (1≤N≤1,000,0001 \le N \le 1{,}000{,}000)

The second line gives the integers AiA_i, the numbers of the tickets sold in the first round of ticketing. (1≤Ai≤231−11 \le A_i \le 2^{31} - 1)

Output

Print the smallest number among the tickets Yanghani can get in the second round of ticketing.

Examples2

  1. Example 1

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

    Input
    3
    7 8 9
    
    Expected output
    1