#include <bits/stdc++.h>
using namespace std;
const int N = 1000 * 100 + 10;
int ary[N];
int val[N];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> ary[i];
    val[min(ary[i], N - 1)]++;
  }
  int sum = 0;
  for (int i = 1; i < N; i++) {
    if (val[i] == 0) {
      sum++;
    } else {
      sum = max(0, sum - val[i] + 1);
    }
  }
  cout << N - sum << endl;
  return 0;
}
