Given is an integer sequence A_1, ..., A_N of length N.

We will choose exactly \left\lfloor \frac{N}{2} \right\rfloor elements from this sequence so that no two adjacent elements are chosen.

Find the maximum possible sum of the chosen elements.

Here \lfloor x \rfloor denotes the greatest integer not greater than x.

Constraints

* 2 \leq N \leq 2\times 10^5
* |A_i|\leq 10^9
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


N
A_1 ... A_N


Output

Print the maximum possible sum of the chosen elements.

Examples

Input

6
1 2 3 4 5 6


Output

12


Input

5
-1000 -100 -10 0 10


Output

0


Input

10
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000


Output

5000000000


Input

27
18 -28 18 28 -45 90 -45 23 -53 60 28 -74 -71 35 -26 -62 49 -77 57 24 -70 -93 69 -99 59 57 -49


Output

295
//make sure to make new file!
import java.io.*;
import java.util.*;

public class Main{
   
   public static void main(String[] args)throws IOException{
      BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
      PrintWriter out = new PrintWriter(System.out);
      
      int n = Integer.parseInt(f.readLine());
      
      StringTokenizer st = new StringTokenizer(f.readLine());
      
      long[] array = new long[n];
      for(int k = 0; k < n; k++){
         array[k] = Long.parseLong(st.nextToken());
      }
      
      if(n%2 == 0){
         long[][] dp = new long[n][2];
         
         for(int k = 0; k < n; k++) Arrays.fill(dp[k],Long.MIN_VALUE);
         dp[0][0] = array[0];
         dp[1][1] = array[1];
         
         for(int k = 0; k < n; k++){
            for(int j = 0; j < 2; j++){
               if(dp[k][j] == Long.MIN_VALUE) continue;
               
               //no skip
               if(k+2 < n){
                  dp[k+2][j] = Math.max(dp[k+2][j],dp[k][j] + array[k+2]);
               }
               //1 skip
               if(k+3 < n && j < 1){
                  dp[k+3][j+1] = Math.max(dp[k+3][j+1],dp[k][j] + array[k+3]);
               }
            }
         }
         
         long answer = Math.max(dp[n-2][0],dp[n-1][1]);
         
         out.println(answer);
      
      
      } else {
         
         long[][] dp = new long[n][3];
         
         for(int k = 0; k < n; k++) Arrays.fill(dp[k],Long.MIN_VALUE);
         dp[0][0] = array[0];
         dp[1][1] = array[1];
         dp[2][2] = array[2];
         
         for(int k = 0; k < n; k++){
            for(int j = 0; j < 3; j++){
               if(dp[k][j] == Long.MIN_VALUE) continue;
               
               //no skip
               if(k+2 < n){
                  dp[k+2][j] = Math.max(dp[k+2][j],dp[k][j] + array[k+2]);
               }
               //1 skip
               if(k+3 < n && j < 2){
                  dp[k+3][j+1] = Math.max(dp[k+3][j+1],dp[k][j] + array[k+3]);
               }
               //2 skip
               if(k+4 < n && j < 1){
                  dp[k+4][j+2] = Math.max(dp[k+4][j+2],dp[k][j] + array[k+4]);
               }
            }
         }
         
         long answer = Math.max(dp[n-3][0],dp[n-2][1]);
         answer = Math.max(answer,dp[n-1][2]);
         
         out.println(answer);
      
      }
      
      
      

      
      
      
      
      
      out.close();
   }
   
      
}