Candies#353

Candies

0.5 seconds
64 megabytes
Easy

The little boy found himself in a fairy land and saw a road along which bags of candy were laid out. Each bag displays the number of candies it contains. The boy can take two adjacent bags in each hand. What is the greatest number of candies he can take?

Input

The only line contains the number of bags (4 \leq N \leq 10000), followed by non-negative integers separated by spaces — the number of candies in each bag (each number does not exceed ).

Output

Print a single number — the answer to the problem.

Examples

Example 1

Loading
Loading