Yura and attractive array#8326

Yura and attractive array

ثانية
128 ميغابايت
متوسط

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

Loading
Loading

مثال 2

Loading
Loading