#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto &t : a) cin >> t;
  int ans = 0;
  long long eps = 0, ops = 0;
  long long ess = 0, oss = 0;
  for (int i = n - 1; i >= 0; i--)
    (i % 2) ? oss += a[i] * 1ll : ess += a[i] * 1ll;
  for (int i = 0; i < n; i++) {
    if (i & 1) {
      oss -= a[i];
      if (ops + ess == eps + oss) ans++;
      ops += a[i];
    } else {
      ess -= a[i];
      if (ops + ess == eps + oss) ans++;
      eps += a[i];
    }
  }
  cout << ans << "\n";
  return 0;
}
