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
Sample 1
Input
5
1 2 3 4 5
Output
9
Sample 2
Input
4
1 1 1 1
Output
10