#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  int vis[4000] = {0};
  int ans = 1;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    vis[x] = 1;
    if (x == ans) {
      while (vis[ans] != 0) ans++;
    }
  }
  cout << ans << "\n";
}
