#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200050;
int n, ar[MAXN], sum, pre[MAXN], ans;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &ar[i]);
    pre[i] = pre[i - 1] + ar[i];
  }
  ans = pre[n];
  for (int i = n - 1; i >= 2; i--) {
    ans = max(pre[i] - ans, ans);
  }
  printf("%d", ans);
  return 0;
}
