水题
#include <iostream>
#include <unordered_set>
using namespace std;
const int N = 1000;
unordered_set<int> seen;
int n, x;
int main(void) {
cin >> n;
while (n--) {
cin >> x;
seen.emplace(x);
}
for (int i = 0; i <= N; ++i)
if (!seen.count(i)) return printf("%d\n", i), 0;
return 0;
}