#include <bits/stdc++.h>
using namespace std;
int n, a[200007];
int main() {
  scanf("%d", &n);
  int tmp;
  for (int i = 3; i <= n + 2; i++) {
    scanf("%d", &tmp);
    a[i] = a[i - 2] + tmp;
  }
  int cnt = 0;
  for (int i = 3; i <= n + 2; i++) {
    int oddpre, oddlat, evenpre, evenlat;
    if (i % 2) {
      evenpre = a[i - 1];
      oddpre = a[i - 2];
      if (n % 2) {
        oddlat = a[n + 2] - a[i];
        evenlat = a[n - 1 + 2] - a[i - 1];
      } else {
        evenlat = a[n + 2] - a[i - 1];
        oddlat = a[n - 1 + 2] - a[i];
      }
    } else {
      oddpre = a[i - 1];
      evenpre = a[i - 2];
      if (n % 2) {
        oddlat = a[n + 2] - a[i - 1];
        evenlat = a[n - 1 + 2] - a[i];
      } else {
        evenlat = a[n + 2] - a[i];
        oddlat = a[n - 1 + 2] - a[i - 1];
      }
    }
    if (oddpre + evenlat == oddlat + evenpre) {
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
