#include <bits/stdc++.h>
using namespace std;
const long long ooT = 1e18;
const int ooU = 2e9;
template <class TT>
TT gcd(TT a, TT b) {
  return b ? gcd(b, a % b) : a;
};
int read() {
  char c = getchar();
  int d = 0, f = 1;
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') f = -1;
  for (; c >= '0' && c <= '9'; d = d * 10 + c - 48, c = getchar())
    ;
  return d * f;
}
int n, a[200001], f[200001];
int main() {
  n = read();
  for (int i = 1; i <= n; i++) a[i] = read() + a[i - 1];
  a[1] = 0;
  int ans = 0;
  for (int i = 1; i <= n; i++) f[i] = -ooU;
  f[n] = a[n];
  for (int i = n - 1; i >= 2; i--) f[i] = max(a[i] - f[i + 1], f[i + 1]);
  cout << f[2] << endl;
}
