Chef gives you a sequence
of length .Let denote the of the sequence . Chef is interested in the count of positive values , such that, if every element of is replaced by , the of the sequence still remains
.
Find the count of such values. If there are infinite such values, print
instead.
As a friendly reminder, the
of a sequence is the smallest non-negative integer that does not belong to the sequence. For instance:
- The
- does not.
Input Format
- The first line of the input contains a single integer
- .
Output Format
For each test case print a single integer — the count of positive values
satisfying the given condition. If there are infinite such values, printinstead.
Constraints
- .
Sample Input 1
3
4
1 2 3 5
1
0
7
5 10 2 4 0 6 1
Sample Output 1
0
-1
1
Explanation
- Test case
ConversionConversion EmoticonEmoticon