# Special Deal

There’s a special deal on CodeAny platform: “Select $3$ video courses, pay for the $2$ most expensive ones.” This means that for every set of $3$ courses chosen, the cheapest one is free. Customers can choose more than $3$ courses, and depending on how they organize them into groups of three, they can get the cheapest course in each group for free.

For instance, if a customer selects courses with prices: $10,3,2,4,6,4$ and $9$, and arranges them into groups like $(10,3,2),(4,6,4)$, and $(9)$, they’ll receive the course priced at $2$ from the first group, and the course priced at $4$ from the second group for free. The third group won’t yield any free courses because it contains only one course.

The employee on CodeAny platform aims to minimize the total cost for each customer. Given the course prices, the task is to assist the employee in organizing the courses into groups in the most cost-effective way possible. It’s not necessary for each group to contain exactly $3$ courses, but the number of courses in a group must range from $1$ to $3$, inclusive.

## Input

The first line contains the integer $n(1≤n≤10_{5})$, the number of video courses the customer bought.

Each of the following $n$ lines contains a single integer $c_{i}(1≤c_{i}≤10_{5})$, the price of each video course.

## Output

Print required minimum price.

## Examples

## Scoring

This task consists of the following subtasks. If all tests of a subtask are passed, you will earn points for that subtask.

($35$ points): $n≤1000$;

($65$ points): $noadditionalconstrains$;