#include <bits/stdc++.h>
using namespace std;
istream& in = cin;
int n;
long long a[200010];
void input() {
  in >> n;
  for (int i = 1; i <= n; ++i) in >> a[i];
}
int main() {
  int TEST_CASE = 1;
  while (TEST_CASE-- > 0) {
    input();
    long long sum = 0;
    for (int i = 1; i <= n; ++i) sum += a[i];
    long long mmax = sum;
    for (int i = n - 1; i >= 2; --i) {
      sum -= a[i + 1];
      long long v = sum - mmax;
      mmax = max(mmax, v);
    }
    cout << mmax << endl;
  }
  return 0;
}
