Add All#1228

Add All

2 seconds
128 megabytes
Very easy

The cost of adding two numbers is equal to their sum. For example, to add to , you need to pay . The task is to add all the given numbers in such a way as to minimize the total cost.

For example, adding the numbers , , and can be done in three ways:

The first method is the cheapest.

Input

The first line contains a positive integer n~(2 \le n \le 10^5). The second line contains non-negative integers, each not exceeding 10^5.

Output

Print the minimum cost of adding all the numbers.

Examples

Example 1

Loading
Loading