#include <bits/stdc++.h>
const int maxn = 0x3f3f3f3f;
const double EI =
    2.71828182845904523536028747135266249775724709369995957496696762772407663035354594571382178525166427;
const double PI = 3.141592653589793238462643383279;
using namespace std;
long long c[200010];
long long mm[200010], mi[200010];
long long dp[200010];
int main(void) {
  int n, i, j;
  long long sum, MM, MI, z1, z0;
  while (~scanf("%d", &n)) {
    mi[0] = 0;
    mm[0] = 0;
    sum = 0;
    for (i = 1; i <= n; i++) {
      scanf("%lld", c + i);
      sum += c[i];
      mi[i] = sum;
      mm[i] = sum;
    }
    long long mmm = mi[n];
    dp[n] = mmm;
    for (i = n - 1; i >= 2; i--) {
      dp[i] = max(mi[i] - mmm, mmm);
      mmm = max(mmm, mi[i] - mmm);
    }
    printf("%lld\n", dp[2]);
  }
  return 0;
}
