Yura and attractive array#8326

Yura and attractive array

1 second
128 megabytes
Medium (≈1350)

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.

Input

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.

Output

Print one number - the attractiveness of array.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading