#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int MAXN = 200005;
ll n, in[MAXN], sumo, sume;
ll judge(int id) {
  ll a, b;
  a = sumo;
  b = sume;
  if (id & 1)
    a -= in[id];
  else
    b -= in[id];
  return a - b;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int res;
  ll a, b;
  while (cin >> n) {
    res = 0;
    a = b = sumo = sume = 0;
    for (int i = 1; i <= n; i++) {
      cin >> in[i];
      if (i & 1)
        sumo += in[i];
      else
        sume += in[i];
    }
    for (int i = 1; i <= n; i++) {
      ll tmp = judge(i);
      if (tmp == a - b) res++;
      if (i & 1) {
        a += in[i];
        sumo -= in[i];
      } else {
        b += in[i];
        sume -= in[i];
      }
    }
    cout << res << '\n';
  }
  return 0;
}
