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