#include <bits/stdc++.h>
template <typename element_type>
std::vector<element_type> read_vector(int size);
std::vector<int> partial_sums(const std::vector<int>& v);
using namespace std;
int main() {
  int stickers;
  while (cin >> stickers) {
    vector<int> sticker = read_vector<int>(stickers);
    vector<int> partial_sum = partial_sums(sticker);
    vector<int> result(stickers);
    result.back() = partial_sum.back();
    int best = result.back();
    for (int n = stickers - 1; n > 1; n--) {
      result[n - 1] = partial_sum[n] - best;
      best = max(best, result[n - 1]);
    }
    cout << best << '\n';
  }
}
template <typename element_type>
std::vector<element_type> read_vector(int size) {
  std::vector<element_type> ret(size);
  for (int i = 0; i < size; i++) std::cin >> ret[i];
  return ret;
}
std::vector<int> partial_sums(const std::vector<int>& v) {
  std::vector<int> ret(v.size() + 1);
  for (int i = 0; i < v.size(); i++) ret[i + 1] = ret[i] + v[i];
  return ret;
}
