#arc148a. [arc148_a]mod M
[arc148_a]mod M
Problem Statement
You are given a sequence .
You may perform the following operation exactly once.
- Choose an integer at least . Then, for every integer (), replace with the remainder when is divided by .
For instance, if is chosen when , becomes .
Find the minimum possible number of different elements in after the operation.
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
3
1 4 8
Sample Output 1
2
If you choose , you will have $A = (1 \\bmod 3, 4 \\bmod 3, 8 \\bmod 3) = (1, 1, 2)$, where contains two different elements.
The number of different elements in cannot become , so the answer is .
Sample Input 2
4
5 10 15 20
Sample Output 2
1
If you choose , you will have , which is optimal.
Sample Input 3
10
3785 5176 10740 7744 3999 3143 9028 2822 4748 6888
Sample Output 3
1