#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
const double E = exp(1);
const int N = 1e5 + 5;
int n;
map<long long, long long> m;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;
    if (!m.count(a)) m[a] = 0;
    m[a]++;
  }
  long long at = 0;
  long long s;
  long long f = 0;
  for (map<long long, long long>::iterator it = m.begin(); it != m.end();
       it++) {
    s = it->first;
    long long x = it->second;
    at += s - f;
    at = max(0LL, at - x);
    f = s;
  }
  cout << s - at + 1 << endl;
  return 0;
}
