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