Let’s say, min is the minimum element of an array and max is the maximum element of an array. The score of an array is defined as the number of integers in the range from min to 2 * max which can not be divided by any of the elements of the array. The total score of an array is defined as the sum of the score of the sub-arrays which are also the suffix of the array. You will be given an array. Show the total score of the array.
The first line of input consists of a single integer — the length of the array.
The next line consists of integers — the elements of the array.
Output a single integer that denotes the total score of the array.
Input | Output |
---|---|
2 2 3 | 3 |
In the sample test case, the given array is . The array has two sub-arrays which are also the suffix of the array. They are and .
In sub array [2,3]: . In the range, is not divisible by any of the elements of the sub array. So, the score is 1.
In sub array [3]: . In the range, and are not divisible by any of the elements of the sub array. So, the score is 2.
So, the total score is