#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  ios_base::sync_with_stdio(0);
  solve();
  return 0;
}
const int MAXN = 200100;
vector<long long int> arr;
vector<long long int> part;
long long int dp[MAXN];
int n;
void solve() {
  cin >> n;
  arr.resize(n);
  for (long long int& x : arr) cin >> x;
  partial_sum((arr).begin(), (arr).end(), back_inserter(part));
  dp[n - 1] = part.back();
  for (int i = n - 2; i >= 0; --i) {
    dp[i] = max(dp[i + 1], part[i] - dp[i + 1]);
  }
  cout << dp[1];
}
