#include <bits/stdc++.h>
using namespace std;
int a[200005], sum[200005], dp[200005];
void Max(int &a, int b) {
  if (a < b) a = b;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    sum[i] = sum[i - 1] + a[i];
  }
  int mx = dp[n] = sum[n];
  for (int i = n - 1; i >= 2; i--) {
    dp[i] = sum[i] - mx;
    Max(mx, dp[i]);
  }
  printf("%d\n", mx);
  return 0;
}
