簽到
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <cmath>
using namespace std;
const int maxn = 1e6 + 7;
map<string,int>mp;
int vis[maxn];
int trans(string now) {
int ans = 0;
for(int i = 0;i < now.size();i++) {
ans = ans * 10 + now[i] - '0';
}
return ans;
}
int main() {
ios::sync_with_stdio(false);
int n;cin >> n;
for(int i = 1;i <= n;i++) {
string tmp;cin >> tmp;
if(tmp[0] == '-') continue;
if(tmp.size() > 7) continue;
int now = trans(tmp);
if(now > n + 1) continue;
vis[now] = 1;
}
for(int i = 0;i <= n;i++) {
if(!vis[i]) {
cout << i << endl;
return 0;
}
}
return 0;
}