#include <bits/stdc++.h>
using namespace std;
int a[1000000];
int main() {
  int n;
  cin >> n;
  int sodd = 0, seven = 0, aodd = 0, aeven = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (i % 2 == 1) {
      sodd += a[i];
    } else {
      seven += a[i];
    }
  }
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    if (i % 2 == 1) {
      sodd -= a[i];
    } else {
      seven -= a[i];
    }
    if (sodd + aeven == seven + aodd) {
      sum++;
    }
    if (i % 2 == 1) {
      aodd += a[i];
    } else {
      aeven += a[i];
    }
  }
  cout << sum;
  return 0;
}
