#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int main() {
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  vector<long long> so(n + 1, 0), se(n + 1, 0);
  for (int i = 0; i < (n); ++i) {
    if (i == 0)
      se[i + 1] = a[i];
    else if (i == 1) {
      so[i + 1] = a[i];
      se[i + 1] = se[i];
    } else if (i % 2 == 0) {
      se[i + 1] = se[i] + a[i];
      so[i + 1] = so[i];
    } else {
      so[i + 1] = so[i] + a[i];
      se[i + 1] = se[i];
    }
  }
  int ans = 0;
  for (int i = 0; i < (n); ++i) {
    long long sume = 0, sumo = 0;
    sume += se[i] - se[0] + so[n] - so[i + 1];
    sumo += so[i] - so[0] + se[n] - se[i + 1];
    if (sume == sumo) ans++;
  }
  cout << ans << endl;
}
