#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a[200001];
  for (int i = 1; i < n + 1; i++) {
    cin >> a[i];
    a[i] = a[i] + a[i - 1];
  }
  long long optSubst = a[n];
  for (int i = n - 1; i > 1; i--) {
    optSubst = max(optSubst, a[i] - optSubst);
  }
  cout << optSubst << endl;
  return 0;
}
