#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, sum = 0, ct = 0;
  cin >> n;
  vector<long long int> vo;
  vector<long long int> ve;
  ve.push_back(0);
  long long int a[n + 1], sumo = 0, sume = 0;
  for (long long int i = 1; i <= n; i++) {
    cin >> a[i];
    sum += a[i];
    if (i % 2 == 0) {
      sume += a[i];
      ve.push_back(sume);
    } else {
      sumo += a[i];
      vo.push_back(sumo);
    }
  }
  for (long long int i = 1; i <= n; i++) {
    long long int k, kk;
    if (i % 2 == 0) {
      k = ve[(i - 2) / 2] + sumo - vo[(i - 1) / 2];
      kk = vo[(i - 1) / 2] + sume - ve[i / 2];
      if (k == kk) {
        ct++;
      }
    } else if (i % 2 != 0) {
      if (i > 1) {
        k = ve[(i - 1) / 2] + sumo - vo[(i - 1) / 2];
        kk = vo[(i - 2) / 2] + sume - ve[(i - 1) / 2];
      } else {
        k = ve[(i - 1) / 2] + sumo - vo[i / 2];
        kk = sume - ve[(i - 1) / 2];
      }
      if (k == kk) {
        ct++;
      }
    }
  }
  cout << ct << '\n';
  return 0;
}
