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