Given an array of integers, , compute the number of unique ways to satisfy the equation , where and . To be unique, each counted equation after being filled in must never have been counted before.
Input Specification
The first line will contain a single integer , .
The next line will contain space separated integers, describing the array.
Output Specification
The output will contain a single line, the number of unique triples that can be formed by the array.
Sample Input 1
4
1 5 3 2
Sample Output 1
2
Explanation for Sample 1
The unique equations are and
Sample Input 2
5
1 1 1 2 3
Sample Output 2
2
Explanation for Sample 2
The unique equations are and
Comments
For the second sample, why is equal to 4 when there are 5 elements in the array?
Fixed