#include <bits/stdc++.h>
using namespace std;
long long sum[200005];
void Rd(long long &res) {
  res = 0;
  char p;
  int k = 1;
  while (p = getchar(), !(p >= '0' && p <= '9') && p != '-')
    ;
  if (p == '-') k = -1, p = getchar();
  do {
    res = (res << 1) + (res << 3) + (p ^ 48);
  } while (p = getchar(), p >= '0');
  res *= k;
}
long long n;
int main() {
  Rd(n);
  for (int i = 1; i <= n; i++) {
    Rd(sum[i]);
    sum[i] += sum[i - 1];
  }
  long long Mi = sum[n];
  for (int i = n - 1; i > 1; i--)
    if (sum[i] - Mi > Mi) Mi = sum[i] - Mi;
  cout << Mi << endl;
  return 0;
}
