Let an array be good if and only if you can make it empty by performing any number of the following two types of operations:
- If is divisible by , divide by .
- If , delete . The elements to the right of are shifted left to accommodate the deletion.
Given an array , count the number of good subarrays in . Two good subarrays are counted separatedly if they span different indexes in , even if the elements they contain are the same.
Constraints
Subtask 1 [50%]
Subtask 2 [50%]
No additional constraints.
Input Specification
The first line contains a single integer, .
The second line contains space-separated integers, .
Output Specification
Output a single line containing the number of good subarrays in . Note that this number may be too large to fit in a 32-bit integer.
Sample Input
4
1 2 6 1
Sample Output
5
Explanation
For example, the array is good because, it can be made empty using the following operations:
- Divide the third element by , resulting in the array .
- Divide the second element by , resulting the array .
- Delete the first element, resulting in the array .
- Divide the second element by , resulting the array .
- Delete the first element, resulting in the array .
- Delete the first element, resulting in the empty array.
Comments