### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest
import itertools

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    #n,m,k=map(int, readline().rstrip().split())
    #
    n=int(readline())
    aa=list(map(int, readline().rstrip().split()))
    #ss=readline().rstrip()
    #yn(1)
    c=n//2
    ans=0
    for cmb in itertools.combinations(list(range(n-c+1)),c):
        rui=0
        sm=0
        for i in range(len(cmb)):
            sm+=aa[cmb[i]+rui]
            rui+=1
        ans=max(ans,sm)
    print(ans)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------
