#include <bits/stdc++.h>
using namespace std;
int arr[300000];
int main(void) {
  int n;
  cin >> n;
  memset(arr, 0, sizeof(arr));
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int m = (n + 1) / 2;
  long long curr = 0L;
  for (int i = 0; i <= m; i++) {
    curr += arr[2 * i];
  }
  long long ans = curr;
  for (int i = 0; i <= n - 2; i++) {
    curr -= arr[(2 * i) % n];
    curr += arr[(2 * (i + m)) % n];
    ans = max(ans, curr);
  }
  cout << ans << endl;
  return 0;
}
