#D6516. Gag
Gag
Gag
Gag
Segtree has of "gags", each with a value of .
Segtree decided to publish all the gags in any order.
Here, the "joy" you get when you publish the th gag to the th is expressed as .
Find the maximum sum of the "joy" you can get.
input
Input is given from standard input in the following format.
output
Please output the maximum value of the sum of "joy". However, the value does not always fit in a 32-bit integer.
Insert a line break at the end.
Constraint
- All inputs are integers.
Input example 1
1 59549
Output example 1
59548
Input example 2
Five 2 1 8 5 7
Output example 2
8
Example
Input
1 59549
Output
59548
inputFormat
input
Input is given from standard input in the following format.
outputFormat
output
Please output the maximum value of the sum of "joy". However, the value does not always fit in a 32-bit integer.
Insert a line break at the end.
Constraint
- All inputs are integers.
Input example 1
1 59549
Output example 1
59548
Input example 2
Five 2 1 8 5 7
Output example 2
8
Example
Input
1 59549
Output
59548
样例
1
59549
59548