#include <bits/stdc++.h>
using namespace std;
long long s[200005], f[200005];
int n;
inline int Read() {
  int t = 0, f = 1;
  char c = getchar();
  for (; c > 57 || c < 48; c = getchar())
    if (c == '-') f = -1;
  for (; c > 47 && c < 58; c = getchar()) t = (t << 1) + (t << 3) + c - 48;
  return t * f;
}
int main() {
  n = Read();
  for (int i = 1; i <= n; i++) s[i] = s[i - 1] + 1ll * Read();
  f[n] = s[n];
  for (int i = n - 1; i > 1; i--) f[i] = max(f[i + 1], s[i] - f[i + 1]);
  cout << f[2] << endl;
}
