#include <bits/stdc++.h>
using namespace std;
bool compare(pair<long long, long long> pair1,
             pair<long long, long long> pair2) {
  return (pair1.first > pair2.first);
}
int main() {
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  long long res = -1;
  long long r = n + 1;
  if (v[0] - 1 > n) {
    res = v[0] - 1;
  }
  for (int i = 1; i < n; i++) {
    if (i + 1 > v[i]) {
      r = min(r, v[i] + n - i);
    }
    if (v[i] - v[i - 1] > n - i + 1) {
      res = max(res, v[i] - (v[i] - v[i - 1] - n + i) + 1);
    }
  }
  cout << (res > 1 ? r : r) << endl;
  return 0;
}
