#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200000;
const int INF = (1 << 28);
int sum[MAXN + 2];
int solucion, dp;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int N;
  cin >> N;
  for (int i = N; i >= 1; i--) {
    cin >> sum[i];
    sum[i] += sum[i + 1];
  }
  int indice = 1, mayor = sum[1];
  int aux;
  for (int i = 2; i <= N; i++) {
    solucion = sum[indice] - dp;
    aux = sum[i] - solucion;
    if (aux > mayor) {
      mayor = aux;
      indice = i;
      dp = solucion;
    }
  }
  cout << solucion << "\n";
  return 0;
}
