A positive integer and a sequence of length are given. Find the number of integer pairs that satisfy the following conditions.
- .
- The arithmetic mean of the subarray is an integer.
Input
The input is given in the following format.
Output
Print the answer of the problem on the first line.
Constraints
- .
- ().
Subtasks
Samples
예제 1
입력
5
1 2 3 4 5
출력
9
예제 2
입력
4
1 1 1 1
출력
10