#include <bits/stdc++.h>
using namespace std;
const char NL = '\n';
long long int mod = 1000000007;
clock_t startTime;
double getCurrentTime() {
  return (double)(clock() - startTime) / CLOCKS_PER_SEC;
}
void read(vector<long long int> &a) {
  for (auto &it : a) cin >> it;
}
inline void solve() {
  long long int n;
  cin >> n;
  vector<long long int> a(n);
  read(a);
  vector<pair<long long int, long long int>> dp(n + 1), dpr(n + 1);
  long long int odd{}, even{};
  for (long long int i = 1; i < n + 1; i++) {
    if (i % 2)
      odd += a[i - 1];
    else
      even += a[i - 1];
    dp[i] = {odd, even};
  }
  odd = 0, even = 0;
  for (long long int i = n; i >= 1; i--) {
    if (i % 2)
      odd += a[i - 1];
    else
      even += a[i - 1];
    dpr[i] = {odd, even};
  }
  long long int co = 0;
  for (long long int i = 1; i < n + 1; i++) {
    long long int os{}, es{};
    if (i - 1 > 0) {
      os += dp[i - 1].first;
      es += dp[i - 1].second;
    }
    if (i + 1 <= n) {
      os += dpr[i + 1].second;
      es += dpr[i + 1].first;
    }
    if (os == es) co++;
  }
  cout << co << NL;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  startTime = clock();
  solve();
  fflush(stdin);
  fflush(stdout);
  return 0;
}
