#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> v(n + 1);
  vector<long long> sume(n + 1), sumo(n + 1);
  sume[0] = 0;
  sumo[0] = 0;
  long long e = 0, o = 0;
  for (long long i = 1; i <= n; i++) {
    cin >> v[i];
    if (i % 2 == 0) {
      sume[i] = (v[i] + sume[i - 1]);
      sumo[i] = 0 + sumo[i - 1];
    } else {
      sumo[i] = v[i] + sumo[i - 1];
      sume[i] = 0 + sume[i - 1];
    }
  }
  long long count = 0;
  for (long long i = 1; i <= n; i++) {
    long long ce, co;
    ce = sume[i - 1];
    co = sumo[i - 1];
    ce += sumo[n] - sumo[i];
    co += sume[n] - sume[i];
    if (ce == co) count++;
  }
  cout << count << endl;
  return 0;
}
