#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000;
const long long inf = (long long)1 << 60;
int n;
long long ss[maxn + 5];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%lld", ss + i), ss[i] += ss[i - 1];
  long long now = ss[n];
  for (int i = n - 1; i >= 2; --i) {
    now = max(now, ss[i] - now);
  }
  printf("%lld\n", now);
  return 0;
}
