#include <bits/stdc++.h>
using namespace std;
const int M = 200000;
int i, j, n, m, x, k, r, s, S[M + 11];
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &x);
    S[i] = S[i - 1] + x;
  }
  s = S[n];
  for (i = n - 1; i > 1; i--) s = max(s, S[i] - s);
  printf("%d", s);
}
