#include <bits/stdc++.h>
using namespace std;
pair<int, int> pp[10];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int i, j, k, l, m, n, even1 = 0, odd1 = 0, count = 0, t, even2 = 0, odd2 = 0,
                        even = 0, odd = 0;
  cin >> t;
  int a[t];
  for (i = 0; i < t; i++) {
    cin >> a[i];
    if (i % 2 == 0) {
      odd1 = odd1 + a[i];
    } else {
      even1 = even1 + a[i];
    }
  }
  for (i = 0; i < t; i++) {
    odd = even1 + odd2 - even2;
    even = odd1 + even2 - odd2;
    if (i % 2 == 0) {
      odd2 = odd2 + a[i];
      even = even - a[i];
    } else {
      even2 = even2 + a[i];
      odd = odd - a[i];
    }
    if (even == odd) count++;
  }
  cout << count << endl;
}
