#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 200;
int a[N];
int main() {
  long long n, sum, ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i += 2) {
    sum += a[i];
  }
  for (int i = n - 1, j = 1; j <= n; j++) {
    ans = max(ans, sum);
    sum += a[(i + 2) % n];
    sum -= a[(i + 1) % n];
    i = (i + 2) % n;
  }
  cout << ans << endl;
  return 0;
}
