#include<iostream>
#include<bits/stdc++.h>
using namespace std;

#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define deb(x)	cout << #x << " " << x << endl;

typedef long long int ll;

#define N 200001
ll dp[N];
ll ans = 0;
ll a[N];
int choose, n;

void calc(int cur, int count, ll sum) {
	if (count == choose) {
		ans = max(ans, sum);
		return;
	}

	if (cur >= n)
		return;

	calc(cur + 1, count, sum);

	sum = sum + a[cur];

	calc(cur + 2, count+1,  sum);

}

int main() {

	IOS

	cin >> n;

	for (int i = 0; i < n; i++)
		cin >> a[i];

	choose = n/2;

	calc(0, 0, 0);

	cout << ans;

	return 0;
}