#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int &x : a) cin >> x;
  vector<int> b(2 * n);
  for (int i = 0; i < 2; i++) {
    for (int j = i * n, k = 0; j < (i + 1) * n; j++, k += 2) {
      if (k > n) k = 1;
      b[j] = a[k];
    }
  }
  long long crnt = 0, ans = 0;
  int to = (n + 1) / 2;
  for (int i = 0; i < 2 * n; i++) {
    if (i < to)
      crnt += b[i];
    else
      crnt = crnt - b[i - to] + b[i];
    ans = max(ans, crnt);
  }
  cout << ans << endl;
  return 0;
}
