#include <bits/stdc++.h>
using namespace std;
int a[200005];
long long sume[200005], sumo[200005];
int ssume = 0, ssumo = 0;
int n;
long long ans = 0;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  if (n == 1) {
    cout << '1' << endl;
    return 0;
  } else if (n == 2) {
    cout << "0" << endl;
    return 0;
  }
  if ((n - 1) & 1)
    sume[n - 1] = a[n];
  else
    sumo[n - 1] = a[n];
  for (int i = n - 2; i >= 1; i--) {
    if (i & 1) {
      sumo[i] = sumo[i + 2] + a[i + 2];
      sume[i] = sume[i + 1] + a[i + 1];
    } else {
      sume[i] = sume[i + 2] + a[i + 2];
      sumo[i] = sumo[i + 1] + a[i + 1];
    }
  }
  for (int i = 1; i <= n; i++) {
    if (i & 1) {
      if (sume[i] + ssumo == sumo[i] + ssume) ans++;
      ssumo += a[i];
    } else {
      if (sumo[i] + ssume == sume[i] + ssumo) ans++;
      ssume += a[i];
    }
  }
  cout << ans << endl;
  return 0;
}
