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