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