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