#include <bits/stdc++.h>
using namespace std;
int n, i, j, k, l;
int v[2 * 2100];
int dp[93][2][2100][2 * 93];
bitset<2 * 93> used[93][2][2100];
int& get_state(int k, int u, int l, int r) {
  int auxi = 93 + l - (n - r);
  return dp[k][u][l][93 + l - (n - r)];
}
int solve(int k, int u, int l, int r) {
  int& act = get_state(k, u, l, r);
  if (used[k][u][l][93 + l - (n - r)] == true) return act;
  used[k][u][l][93 + l - (n - r)] = true;
  if (u == 0) {
    if (r - l + 1 < k) return act = 0;
    act = solve(k, 1, l + k, r) + v[l + k - 1] - v[l - 1];
    if (r - l + 1 >= k + 1)
      act = max(act, solve(k + 1, 1, l + k + 1, r) + v[l + k] - v[l - 1]);
  } else {
    if (r - l + 1 < k) return act = 0;
    act = solve(k, 0, l, r - k) - (v[r] - v[r - k]);
    if (r - l + 1 >= k + 1)
      act = min(act, solve(k + 1, 0, l, r - k - 1) - (v[r] - v[r - k - 1]));
  }
  return act;
}
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &v[i]), v[i] += v[i - 1];
  int ans = solve(1, 0, 1, n);
  printf("%d", ans);
  return 0;
}
