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