#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
int n, m;
long long a[200005], ans;
int read() {
  int x = 0, f = 1;
  char ch;
  for (ch = getchar(); ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') f = -1;
  for (; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0';
  return x * f;
}
int main() {
  n = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  for (int i = 1; i <= n; i++) a[i] += a[i - 1];
  ans = a[n];
  for (int i = n - 1; i > 1; i--) ans = max(ans, a[i] - ans);
  printf("%I64d\n", ans);
  return 0;
}
