#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int a[maxn];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) a[i] = a[i] + a[i - 1];
  long long best = a[n];
  for (int i = n - 1; i >= 2; i--) best = max(best, a[i] - best);
  cout << best << endl;
  return 0;
}
