#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
long long read() {
  long long s = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = s * 10 + ch - '0';
    ch = getchar();
  }
  return s * f;
}
inline void print(long long *f, long long len) {
  for (long long i = 0; i < len; i++) printf("%lld ", f[i]);
  puts("");
}
long long a[402020];
signed main() {
  long long T = 1;
  while (T--) {
    n = read();
    for (long long i = 1, iend = n; i <= iend; ++i) a[i] = a[i + n] = read();
    for (long long i = 1, iend = n * 2; i <= iend; ++i) a[i] += a[i - 2];
    long long ans = 0;
    for (long long i = n + 1, iend = n * 2; i <= iend; ++i)
      ans = max(ans, a[i] - a[i - n - 1]);
    cout << ans;
  }
}
