#include <bits/stdc++.h>
using namespace std;
int x[200001];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n + 1; ++i) scanf("%d", x + i), x[i] += x[i - 1];
  int mx = x[n], an;
  for (int i = n; i > 1; --i) an = mx, mx = max(mx, x[i - 1] - mx);
  printf("%d\n", an);
}
