Little L has a non-negative integer array $$$a = [a_1, a_2, \dots, a_n]$$$ of length $$$n$$$. The elements in the array may repeat, and each element can be any non-negative integer (that is, $$$a_i \ge 0$$$, with no upper bound). Little L chooses an unknown positive integer $$$m$$$, and performs a modulo operation on every element of array $$$a$$$, obtaining a new array $$$b$$$, where $$$b_i = a_i \bmod m$$$.
Now Little L tells you the array $$$b$$$, but both the original array $$$a$$$ and the modulus $$$m$$$ are unknown. He wants to know: among all possible original arrays $$$a$$$ and modulus $$$m$$$, how many different values can its $$$\text{mex}$$$ take?
The definition of $$$\text{mex}$$$: the smallest non-negative integer that does not appear in the array. For example, $$$\text{mex}\{0, 1, 3\} = 2$$$, and $$$\text{mex}\{1, 2, 3\} = 0$$$.
The first line contains an integer $$$n$$$ ($$$1 \le n \le 10^5$$$), the length of the array.
The second line contains $$$n$$$ integers $$$b_1, b_2, \dots, b_n$$$ ($$$0 \le b_i \le 10^9$$$), representing the array $$$b$$$ given by Little L.
Output an integer representing the number of possible values of $$$\text{mex}$$$ of the original array $$$a$$$.
60 1 2 3 1 2
5
For the example, all possible $$$\text{mex}$$$ values are $$$\{0,1,2,3,4\}$$$. For example, when $$$\text{mex}=3$$$, one possible construction is $$$m=5$$$, $$$a=\{0,1,2,8,6,7\}$$$.
| Название |
|---|


