#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d = 1;
  cin >> n;
  int arr[n];
  bool check = true;
  for (int x = 0; x < n; x++) cin >> arr[x];
  while (check) {
    for (int x = 0; x < n; x++) {
      if (x == n - 1) {
        if (d == arr[x]) {
          d++;
          break;
        } else
          check = false;
      } else if (d == arr[x]) {
        d++;
        break;
      }
    }
  }
  cout << d << endl;
  return 0;
}
