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