A box of chocolate
Vite birthday gave a huge box of chocolates. Each candy is made in the form of a round of chocolate coins wrapped in gold or silver foil. Victor - not a greedy boy, so he decided to share candy with her younger sister Masha. Victor called Masha and invited her to choose the most chocolate. And that was interesting, Victor Manechka allowed to choose any chocolate, but so that this choice satisfies the following rules:
All chocolates are rigorously horizontally.
Each chocolate is either on the surface of the table, or on the other chocolates. Thus, some chocolates may form a pile.
All selected chocolates should be in a heap.
In a handful of each chocolate is allowed to put a bar of chocolate or a smaller radius, or four chocolate bars, but so that their edges are not performed by the edges of the chocolate, where they lie.
Of course, Masha loves chocolate, so she wants to take the largest possible number of them. Very interesting how it got chocolate? Chocolates in the box so much that Victor is not afraid that if Manechka will fold hill chocolates, they may not be enough. For example, if a box of chocolate are the radii of 9, 3, 2 and 1, then at the bottom tier can put the first piece of chocolate radius 9, at her - four chocolates radius 3, and each of them - four chocolates radius 1. Total, 1 + 4 + 4*4 = 21 bar of chocolate.
Input In the first line of the input file is written the number N (0 ≤ N ≤ 1000) - the number of types of chocolates in a box. The next line contains N integers - the radii of chocolates, each value does not exceed 10000. Output Display the maximum number of chocolates, which can take Manechka.