Let an array
- If
is divisible by , divide by . - If
, delete . The elements to the right of are shifted left to accommodate the deletion.
Given an array
Constraints
Subtask 1 [50%]
Subtask 2 [50%]
No additional constraints.
Input Specification
The first line contains a single integer,
The second line contains
Output Specification
Output a single line containing the number of good subarrays in
Sample Input
Copy
4
1 2 6 1
Sample Output
Copy
5
Explanation
For example, the array
- 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