#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll n, ini[200200], v[400400], sp[400400], suma_max;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> ini[i];
  int pos = 1;
  for (int i = 1; i <= n; i += 2) v[pos++] = ini[i];
  for (int i = 2; i < n; i += 2) v[pos++] = ini[i];
  for (int i = n + 1; i <= 2 * n; i++) v[i] = v[i - n];
  for (int i = 1; i <= 2 * n; i++) sp[i] = sp[i - 1] + v[i];
  for (int i = 1; i <= n; i++)
    suma_max = max(suma_max, sp[i + (n + 1) / 2 - 1] - sp[i - 1]);
  cout << suma_max;
  return 0;
}
