#include<stdio.h>
#include<math.h>
#define sz 200000
int main()
{
    long long int n,x,i,j,sum,max=0;
    long long int a[sz];
    scanf("%lld",&n);

    if(n%2!=0)
        x = ((ceil)(n/2)) - 1;

    if(n%2==0)
        x = n/2;

    for(i=0;i<n;i++)
        scanf("%lld",&a[i]);

    for(j=0;j<x;j++)
    {
        sum = 0;
        for(i=j;i<n;i+=2)
        {
            sum+=a[i];
        }

        if(sum>max)
            max = sum;
    }

    printf("%lld\n",max);

    return 0;
}
