The monkey gave Yura an array with integers. Yura immediately wanted to determine the attractiveness of this array. He believes that the attractiveness of the array is the number of triples of indices , , , such that 1 \le i < j < k \le n and a_i < a_j < a_k. But Yura still does not know how to program, so asked for your help.
Help Yura to find the attractiveness of the array.
First line contains one integer (1 \le n \le 10^5) - the size of array. Second line contains nonnegative integers - the array elements. All values do not exceed 10^6.
Print one number - the attractiveness of array.
مثال 1
مثال 2