#include <bits/stdc++.h>
using namespace std;
constexpr int nmax = 200005;
int s[nmax];
int n;
int dp[nmax];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    s[i] += s[i - 1];
  }
  int maxdp = s[n];
  dp[n] = s[n];
  for (int i = n - 1; i >= 2; --i) {
    dp[i] = s[i] - maxdp;
    if (dp[i] > maxdp) maxdp = dp[i];
  }
  int ans = dp[2];
  for (int i = 3; i <= n; i++) ans = max(ans, dp[i]);
  cout << ans << '\n';
  return 0;
}
