#include <bits/stdc++.h>
using namespace std;
void print(vector<int> a) {
  for (int i = 0; i < a.size(); i++) cout << a[i] << " ";
  cout << endl;
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n), b;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i % 2 == 0) b.push_back(a[i]);
  }
  for (int i = 0; i < n; i++)
    if (i % 2) b.push_back(a[i]);
  for (int i = 0; i < n; i++) b.push_back(b[i]);
  int l = 0, r = (n + 1) / 2;
  long long sum = 0;
  for (int i = l; i < r; i++) sum += b[i];
  long long ans = -1;
  for (int i = r; i < b.size(); i++) {
    sum -= b[i - r];
    sum += b[i];
    ans = max(ans, sum);
  }
  cout << ans << endl;
  return 0;
}
