#abc140c. [abc140_c]Maximal Value
[abc140_c]Maximal Value
Problem Statement
There is an integer sequence of length whose values are unknown.
Given is an integer sequence of length which is known to satisfy the following:
Find the maximum possible sum of the elements of .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the maximum possible sum of the elements of .
Sample Input 1
3
2 5
Sample Output 1
9
can be, for example, ( , , ), ( , , ), or ( , , ). Among those candidates, = ( , , ) has the maximum possible sum.
Sample Input 2
2
3
Sample Output 2
6
Sample Input 3
6
0 153 10 10 23
Sample Output 3
53