#include <fstream>
#include <algorithm>

using namespace std;

#define maxN 100000

ifstream input("Bai3_16.inp");
ofstream output("Bai3_16.out");
int n;
int a[maxN + 1];
int res = 0;

int main()
{
	a[0] = -1;
	input >> n;
	for (int i = 1; i <= n; ++i)
	{
		input >> a[i];
	}
	sort(a, a + n);
	for (int i = 1; i <= n; ++i)
	{
		if (a[i] != i)
		{
			res = i;
			break;
		}
	}
	if (res == 0)
	{
		res = n + 1;
	}
	output << res;
	input.close();
	output.close();
	return 0;
}