#abc249d. [abc249_d]Index Trio
[abc249_d]Index Trio
Problem Statement
You are given an integer sequence of length .
Find the number of triplets of integers satisfying all of the conditions below.
Constraints
- $1 \\leq A_i \\leq 2 \\times 10^5 \\, (1 \\leq i \\leq N)$
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
3
6 2 3
Sample Output 1
2
satisfy the conditions.
Sample Input 2
1
2
Sample Output 2
0
Sample Input 3
10
1 3 2 4 6 8 2 2 3 7
Sample Output 3
62