Discount#8356

Discount

1 second
128 megabytes
Very easy

In the supermarket there is an action — "Buying any two goods, the third you receive for free, out of three selected goods you pay the two most expensive."

Mamed, going to the supermarket, knows what goods he wants to buy, and knows their prices. Determine the minimum amount of money that he needs to take with him to buy these goods.

Input

The first line contains one number n~(1 \le n \le 1000). Second line contains numbers — the prices of goods chosen by Mamed. All prices are positive integers, no more than .

Output

Print one number — the minimum amount of money that Mamed should take with him to the supermarket.

Examples

Mamed will first pass through the cash register with goods worth and — will pay hryvnia and will receive a commodity worth as a gift, and then again go into supermarket and will buy goods worth and , receiving another product worth as a gift.

Example 1

Loading
Loading