#include <bits/stdc++.h>
using namespace std;
int n, x, ans = -1;
set<int> st;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    if (ans != -1) continue;
    if (i == 1 && x != 0) {
      ans = 1;
      continue;
    }
    st.insert(x);
    if (st.find(x - 1) == st.end() && x != 0) {
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}
