#include <bits/stdc++.h>
using namespace std;
long long ar[200004];
long long prefix[200004];
long long D[200004];
void calc(long n) {
  D[n] = 0;
  long long mx = -1000000000000000000;
  for (long i = n - 1; i >= 1; i--) {
    D[i] = max(mx, prefix[i + 1] - D[i + 1]);
    mx = max(mx, D[i]);
  }
  std::cout << D[1] << endl;
}
int main() {
  std::ios::sync_with_stdio(false);
  ;
  long n;
  std::cin >> n;
  for (long i = 1; i <= n; i++) {
    std::cin >> ar[i];
  }
  prefix[0] = 0;
  for (long i = 1; i <= n; i++) {
    prefix[i] = ar[i] + prefix[i - 1];
  }
  calc(n);
  return 0;
}
