#D7323. War

    ID: 6084 Type: Default 1000ms 268MiB

War

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

inputFormat

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

outputFormat

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

样例

10
10
10
10
10
10
10
10
10
10
10
93