#include <bits/stdc++.h>
using namespace std;
int n, sm[200003 + 2], dp[200003 + 2][2];
int go(int p, int f) {
  if (p == n) {
    if (!f)
      return sm[p];
    else
      return -sm[p];
  }
  int &ret = dp[p][f];
  if (ret != -1) return ret;
  if (!f) {
    ret = -1000000000;
    ret = max(ret, sm[p] + go(p + 1, !f));
    ret = max(ret, go(p + 1, f));
  } else {
    ret = 1000000000;
    ret = min(ret, -sm[p] + go(p + 1, !f));
    ret = min(ret, go(p + 1, f));
  }
  return ret;
}
int main() {
  int i, j, k, x;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &x);
    sm[i] = sm[i - 1] + x;
  }
  memset(dp, -1, sizeof(dp));
  int ans = go(2, 0);
  printf("%d\n", ans);
  return 0;
}
