#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  int *a = new int[n];
  for (int i = (0); i < (n); i += (1)) cin >> (a)[i];
  long long s = 0;
  int k = 1;
  for (int i = (1); i < (n); i += (1)) {
    s += k * a[i];
    k *= -1;
  }
  int t = 0;
  if (s == 0) ++t;
  k = 1;
  for (int i = (1); i < (n); i += (1)) {
    s += k * (a[i - 1] - a[i]);
    k *= -1;
    if (s == 0) ++t;
  }
  cout << t;
  return 0;
}
