#include <bits/stdc++.h>
using namespace std;
long long n, ans, s[200005];
signed main() {
  cin >> n;
  for (long long i = 1, x; i <= n && cin >> x; i++) s[i] = s[i - 1] + x;
  ans = s[n];
  for (long long i = n - 1; i >= 2; i--) ans = max(ans, s[i] - ans);
  cout << ans << endl;
  return 0;
}
