#include <bits/stdc++.h>
long long int oddsum[100020], evensum[100020];
int main() {
  memset(oddsum, 0, sizeof(oddsum));
  memset(evensum, 0, sizeof(evensum));
  int n, i;
  long long int x, ans = 0, sum;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%lld", &x);
    if (i & 1)
      oddsum[(i >> 1) + 1] = oddsum[i >> 1] + x;
    else
      evensum[(i >> 1) + 1] = evensum[i >> 1] + x;
  }
  for (i = 0; i < n; i++) {
    if (i & 1)
      sum =
          oddsum[(i >> 1) + 1] + evensum[(n >> 1) + 1] - evensum[(i >> 1) + 1];
    else
      sum = evensum[(i >> 1) + 1] + oddsum[n >> 1] - oddsum[i >> 1];
    if (ans < sum) ans = sum;
  }
  printf("%lld\n", ans);
  return 0;
}
