#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, i, j, k, x, y;
  cin >> n;
  vector<long long int> vt;
  vt.push_back(0);
  long long int A[n + 1];
  for (i = 1; i <= n; i++) {
    cin >> A[i];
    if (i % 2 == 1) vt.push_back(A[i]);
  }
  for (i = 2; i <= n; i += 2) {
    vt.push_back(A[i]);
  }
  for (i = 1; i <= n; i += 2) {
    vt.push_back(A[i]);
  }
  for (i = 2; i <= n; i += 2) {
    vt.push_back(A[i]);
  }
  for (j = 1; j < vt.size(); j++) {
    vt[j] += vt[j - 1];
  }
  long long int result = 0;
  for (i = (n + 1) / 2; i < vt.size(); i++) {
    result = max(result, vt[i] - vt[i - (n + 1) / 2]);
  }
  cout << result;
  return 0;
}
