#abc245b. B - Mex
B - Mex
Score : points
Problem Statement
You are given a sequence of length consisting of integers: .
Find the smallest non-negative integer not in .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
8
0 3 2 6 2 1 0 0
Sample Output 1
4
The non-negative integers are .
We have in , but not , so the answer is .
Sample Input 2
3
2000 2000 2000
Sample Output 2
0