#include <bits/stdc++.h>
using namespace std;
int num[100011];
int n;
int main() {
  memset(num, 0, sizeof(num[0]));
  scanf("%d", &n);
  int i;
  for (i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    if (x > n) x = n + 1;
    num[x]++;
  }
  int left, con, m;
  left = 0;
  con = 0;
  for (i = 1; i <= n + 1; i++) {
    if (num[i] != 0 && left == 0) con++;
    if (left != 0) {
      m = min(left, num[i]);
      con += m;
      left = left - m;
      num[i] -= m;
    }
    if (num[i] == 0) left++;
    if (left == 0)
      if (num[i] == 0)
        con = i - 1;
      else
        con = i;
  }
  printf("%d\n", con + 1);
  return 0;
}
