#include <bits/stdc++.h>
using namespace std;
int v[200005], dp[200005];
int main() {
  int n, k, i;
  cin >> n;
  for (i = 1; i <= n; ++i) {
    cin >> v[i];
    v[i] += v[i - 1];
  }
  dp[n] = v[n];
  for (i = n - 1; i > 1; --i) dp[i] = max(dp[i + 1], v[i] - dp[i + 1]);
  cout << dp[2];
  return 0;
}
