#include <bits/stdc++.h>
using namespace std;
const int mxn = 2e5 + 5;
int n, mxd, s[mxn];
int main() {
  scanf("%d", &n);
  for (int(i) = (int)(1); (i) <= (int)(n); (i)++) {
    scanf("%d", &s[i]);
    s[i] += s[i - 1];
  }
  mxd = s[n];
  for (int(i) = (int)(n - 1); (i) >= (int)(2); (i)--)
    mxd = max(mxd, s[i] - mxd);
  printf("%d\n", mxd);
}
