p00992 War
Two countries, Country A and Country B, are at war. As a soldier in Country A, you will lead n soldiers to occupy the territory of Country B.

The territory of Country B is represented by a two-dimensional grid. The first place you occupy is a square on the 2D grid. Each of the soldiers you lead has h_i health. Each soldier can spend 1 health to move. Assuming that the current cell is (a, b), the movement destination is the four directions (a + 1, b), (a-1, b), (a, b + 1), (a, b-1). It is possible to choose. Soldiers will not be able to move from there when their health reaches zero. Any square passed by one or more soldiers can be occupied.

Your job is to find out how many squares you can occupy at most.
However, the size of this two-dimensional grid should be infinitely wide.



Input

The input is given in the following format.


n
h1
..
..
..
hn


Input meets the following constraints
1 ≤ n ≤ 500
1 ≤ hi ≤ 10,000,000

Output

Output the answer value on one line

Examples

Input

2
5
5


Output

11


Input

10
10
10
10
10
10
10
10
10
10
10


Output

93


Input

5
1
2
3
4
5


Output

15
```python
a=sorted([int(input()) for _ in [0]*int(input())])
c=b=0
for i in range(len(a)-1,-1,-1):
    if a[i]<c//4:continue
    else:b+=a[i]-c//4
    c+=1
print(b+1)
```