#include <bits/stdc++.h>
using namespace std;
long long a[400005];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i], a[n + i] = a[i];
  ;
  for (int i = 1; i <= 2 * n; i++) a[i] += a[i - 2];
  long long ans = 0;
  for (int i = n + 1; i <= 2 * n; i++) {
    ans = max(ans, a[i] - a[i - n - 1]);
  }
  cout << ans;
}
