beware-of-raghavan
Source: hackerearth
Difficulty: UNKNOWN_DIFFICULTY

Raghavan likes to disturb everyone. He visits rooms in the Hostel and annoys everyone in that room. But when he visits any room , people in the adjacent rooms become aware of his presence and try to avoid him by leaving their rooms. So Raghavan can't visit adjacent rooms. Raghavan wants to maximize his score ( the no. of persons he annoys ).

So Raghavan asks for your help and promises not to disturb you ever again. So help him to find the maximum score possible ...

NOTE :
 Assume all hostel rooms are in a straight line. 

INPUT :
First line contains the no. rooms in the Hostel.
Second line contains N space separated integers Representing no. of peoples in each room.

OUTPUT :
Print max. possible score of Raghavan.

CONSTRAINTS :
1 ≤ No. of rooms in the Hostel  ( N ) ≤10^6
0 ≤ No. of People in any Room ≤ 10^9

Problem Setter : Rajan Kasodariya

SAMPLE INPUT
4
5 2 5 5

SAMPLE OUTPUT
10