Candies#271

Candies

0.5 seconds
64 megabytes
Easy (≈1000)

Little Tunar sees candy packs placed consecutively along a long path in a fairytale land. On each pack, the number of candies inside is indicated. Tunar can take two packs in each hand, but these packs must be adjacent along the path.

I wonder how many candies Tunar can take at most?

Input

The first line of the input provides (4 \le N \le 10000), the number of packs. Then, the quantities of candies written on the packs placed along the path are given as k_1, k_2, k_3, ..., k_n.

Output

Print the answer to the question of the problem.

Examples

Example 1

Loading
Loading

Note

In the example, Tunar can choose the adjacent packs and to take a maximum of 8 + 5 + 7 + 8 = 28 candies.