#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int a[n + 1];
  long long int odd = 0, even = 0, fixedeven = 0, fixedodd = 0;
  for (long long int i = 1; i <= n; i++) {
    cin >> a[i];
    (i % 2) ? odd += a[i] : even += a[i];
  }
  long long int count = 0;
  for (long long int i = 1; i <= n; i++) {
    if (i % 2) {
      if ((odd - a[i] + fixedeven) == even + fixedodd) {
        count++;
      }
      fixedodd += a[i];
      odd -= a[i];
    } else {
      if ((even - a[i] + fixedodd) == odd + fixedeven) {
        count++;
      }
      fixedeven += a[i];
      even -= a[i];
    }
  }
  cout << count << endl;
}
