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