#include <bits/stdc++.h>
using namespace std;
long long sum[200100];
int main() {
  int N;
  scanf("%d", &N);
  long long a;
  scanf("%lld", &a);
  sum[1] = a;
  for (int i = 2; i <= N; ++i) {
    scanf("%lld", &a);
    sum[i] = a + sum[i - 1];
  }
  long long ans = sum[N];
  for (int i = N - 1; i > 1; --i)
    if (ans < (sum[i] - ans)) ans = sum[i] - ans;
  printf("%lld\n", ans);
  return 0;
}
