Problem L. 27. Maximum product score
Input file name: standard input
Output file name: standard output
Time limit: 1 s
Memory limit: 1024 MB
You are given an array A of N non-negative integers. You can rearrange the elements of the array in any order. The score of an arrangement is defined as:
\sum_{i=1}^{N} (A_i \cdot i)
Find the arrangement that maximizes the score and output this maximum total.

Input

The first line contains an integer N (1 \le N \le 10^5). The second line contains N non-negative integers A_i (0 \le A_i \le 10^6).

Output

Print the maximum possible score.

Examples

standard inputstandard output
3 2 2 2 12