#include <bits/stdc++.h>
using namespace std;
int n;
int a[200000], d[200000];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  d[0] = a[0];
  for (int i = 1; i < n; i++) d[i] = d[i - 1] + a[i];
  int sum = d[n - 1];
  for (int i = n - 2; i >= 1; i--) {
    int tmp = d[i] - sum;
    sum = max(sum, tmp);
  }
  cout << sum;
  return 0;
}
