One day little E gets an array of length n, with numbers from left to right subscript to
, we named it
,and you can rearrange the array any way you want.
When one of these numbers goes from subscript to subscript
, then that number can contribute
points. little E wants to ask you to get the maximum score by rearranging the array of A's in you hand
The first line contain one integer
The second line contain n integers
Print one integer — the maximum score