#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long s1, s2, all;
  s1 = 0;
  s2 = 0;
  for (int i = 0; i < n; i += 2) {
    s1 += a[i];
  }
  for (int i = 1; i < n; i += 2) {
    s2 += a[i];
  }
  all = s1 + s2;
  long long f = 0;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      f += a[i];
      s1 -= a[i];
    } else {
      s2 -= a[i];
    }
    if ((all - a[i]) % 2 == 1) continue;
    long long h = 0;
    h += f;
    if (i % 2 == 0) {
      h -= a[i];
    }
    h += s2;
    if (2 * h + a[i] == all) {
      ans += 1;
    }
  }
  cout << ans;
  return 0;
}
