You are given an array of size , where the integer of the array is and its value ranges between and inclusive. You are required to complete the following task:
Assume that you are provided with additional numbers , , and . Your task is to report the number of unordered pairs of elements from this array, such that , , and .
Input format
Output format
Print the required number of ordered pairs of array elements in a single line. As the answer could be rather large, be careful of integer overflows.
Constraints
.