#include <bits/stdc++.h>
const bool debug = false;
using namespace std;
long long powmod(long long a, long long b, long long MOD) {
  long long res = 1;
  a %= MOD;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % MOD;
    a = a * a % MOD;
  }
  return res;
}
void buginfo(const char* f, ...) {
  if (!debug) return;
  va_list al;
  va_start(al, f);
  vprintf(f, al);
  va_end(al);
}
const int maxn = 2e5 + 10;
const int maxa = 2e5 + 10;
int a[maxn], n;
long long dp[maxn], tmp;
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n + 1; ++i) scanf("%d", a + i);
  for (int i = 1; i < n + 1; ++i) a[i] += a[i - 1];
  long long tmp = a[n];
  for (int i = n - 1; i >= 2; --i) {
    tmp = max(tmp, a[i] - tmp);
  }
  printf("%lld\n", tmp);
}
