#include <bits/stdc++.h>
long long int a[100010];
int main() {
  long long int x, y, i, j, k, count = 0, sum = 0, m = 0, n = 0;
  scanf("%I64d", &x);
  for (i = 0; i < x; i++) scanf("%I64d", &a[i]);
  std::sort(a, a + x);
  a[0] = 1;
  for (i = 1; i < x; i++) {
    if (a[i] - a[i - 1] > 2) {
      count += (a[i] - a[i - 1] - 1);
      n = a[i - 1];
      m = i;
    } else if (a[i] - a[i - 1] == 2)
      a[i] -= 1;
    if (count > 0) {
      a[i] = n + 1;
      count = 0;
      n = a[i];
    }
  }
  if (count == 0)
    printf("%I64d", a[x - 1] + 1);
  else
    printf("%I64d", a[m] - 1);
}
