#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y) {
  if (y == 0) return 1;
  long long temp = power(x, int(y / 2));
  if (y % 2 == 0)
    return (((temp % 1000000007) * temp) % 1000000007);
  else
    return ((((x * temp) % 1000000007) * temp) % 1000000007);
}
inline int countsetbit(int n) {
  unsigned int count = 0;
  while (n) {
    n &= (n - 1);
    count++;
  }
  return count;
}
inline int abs(int x) {
  if (x < 0) return -x;
  return x;
}
int main() {
  int n;
  cin >> n;
  long long a[n + 1];
  for (int i = (1); i <= (n); ++i) {
    cin >> a[i];
  }
  a[0] = 0;
  long long c = 0;
  sort(a, a + n + 1);
  for (int i = 1; i <= n; i++) {
    if (a[i] == a[i - 1]) {
      if (c < 0) c++;
    } else if (a[i] != a[i - 1] + 1) {
      c -= (a[i] - a[i - 1] - 1);
    }
  }
  if (c >= 0)
    cout << a[n] + 1 << endl;
  else
    cout << a[n] + c + 1 << endl;
}
