#include <bits/stdc++.h>
using namespace std;
const int MaxN = 200050;
int N, a[MaxN], dp[MaxN];
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; ++i) scanf("%d", &a[i]), a[i] += a[i - 1];
  dp[N] = a[N];
  for (int i = N - 1; i > 1; --i) dp[i] = max(dp[i + 1], a[i] - dp[i + 1]);
  printf("%d", dp[2]);
  return 0;
}
