In the supermarket there is an action — "Buying any two goods, the third you receive free of charge, 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 value. Determine the minimum amount of money that he needs to take with him to buy these goods.
The first line contains one number n (1≤n≤1000). Second line contains n numbers — the prices of goods chosen by Mamed. All prices are positive integers, no more than 10000.
Print one number — the minimum amount of money that Mamed should take with him to the supermarket.
Mamed will first pass through the cash register with goods worth 1,3 and 4 — will pay 7 rubles and a commodity worth 1 will receive as a gift, and then again go into supermarket and will buy goods worth 5 and 7, another product of cost 5 received as a gift.