#include <bits/stdc++.h>
using namespace std;
int main() {
  int oddPref = 0, evenPref = 0, oddSuf = 0, evenSuf = 0, n, k = 0;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i % 2 == 0)
      oddSuf += a[i];
    else
      evenSuf += a[i];
  }
  for (int i = n - 1; i >= 0; i--) {
    if (i % 2 != 0)
      evenSuf = evenSuf - a[i];
    else
      oddSuf = oddSuf - a[i];
    if (evenPref + oddSuf == oddPref + evenSuf) k++;
    if (i % 2 != 0)
      evenPref += a[i];
    else
      oddPref += a[i];
  }
  cout << k;
}
