#include <iostream>
#include <algorithm>
using namespace std;
int main(void)
{
int N;
cin >> N;
int * A = new int [N];
for (int i = 0; i < N; i++)
cin >> A[i];
sort(A, A + N);
int answer = 1;
for (int i = 0; i < N; i++)
{
if (answer != A[i]) break; //다르다면 중지
for (int j = i + 1; j < N; j++) //중복된 값 무시
{
if (A[i] == A[j]) i = j;
else break;
}
answer++;
}
cout << answer;
delete[] A;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKHZvaWQpCnsKCWludCBOOwoJY2luID4+IE47CgoJaW50ICogQSA9IG5ldyBpbnQgW05dOwoKCWZvciAoaW50IGkgPSAwOyBpIDwgTjsgaSsrKQoJCWNpbiA+PiBBW2ldOwoKCXNvcnQoQSwgQSArIE4pOwoJaW50IGFuc3dlciA9IDE7Cglmb3IgKGludCBpID0gMDsgaSA8IE47IGkrKykKCXsKCQlpZiAoYW5zd2VyICE9IEFbaV0pIGJyZWFrOwkJLy/ri6TrpbTri6TrqbQg7KSR7KeACgkJZm9yIChpbnQgaiA9IGkgKyAxOyBqIDwgTjsgaisrKQkvL+ykkeuzteuQnCDqsJIg66y07IucCgkJewoJCQlpZiAoQVtpXSA9PSBBW2pdKSBpID0gajsKCQkJZWxzZSBicmVhazsKCQl9CgkJYW5zd2VyKys7Cgl9Cgljb3V0IDw8IGFuc3dlcjsKCWRlbGV0ZVtdIEE7Cn0=