Discounts-2#7382

Discounts-2

1 second
64 megabytes
Medium

In an electronics supermarket, a discount system is in place: if you buy one item, you pay the full price. If you purchase two items, you get a discount on the cheaper item. For three items, the cheapest one is free. Determine the minimum amount you need to pay when buying items, given that the prices of these items in hryvnias are listed in the array C_{1..N}.

Input

The first line contains the integer (1 \leq N \leq 100). The second line contains integers representing the array C_{1..N}, where each value is a natural number not exceeding .

Output

Output the total cost of the purchase in standard monetary format.

Examples

Example 1

Loading
Loading