#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int n;
long long a[N], dp[N];
long long solve(int i) {
  if (i == n - 1) return a[i];
  if (~dp[i]) return dp[i];
  long long A = solve(i + 1);
  long long B = a[i] - solve(i + 1);
  return dp[i] = max(A, B);
}
int main() {
  memset(dp, -1, sizeof dp);
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%I64d", &a[i]);
    if (i) a[i] += a[i - 1];
  }
  cout << solve(1) << endl;
}
