#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, j, k, r, s, c = 0, l, p, q;
  cin >> n;
  i = 0;
  j = 1;
  long long int a[n], e[(n + 1) / 2], o[n / 2];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (n == 1)
    cout << 1 << endl;
  else {
    e[0] = a[0];
    if (n > 1) o[0] = a[1];
    for (i = 2; i < n; i += 2) {
      e[i / 2] = e[i / 2 - 1] + a[i];
    }
    for (i = 3; i < n; i += 2) {
      o[i / 2] = o[i / 2 - 1] + a[i];
    }
    for (i = 0; i < n; i++) {
      j = (i + 1) / 2;
      k = i - j;
      p = (i + 2) / 2;
      q = i + 1 - p;
      l = (j > 0 ? e[j - 1] : 0) + o[n / 2 - 1] - (q > 0 ? o[q - 1] : 0);
      r = (k > 0 ? o[k - 1] : 0) + e[(n + 1) / 2 - 1] - (p > 0 ? e[p - 1] : 0);
      if (l == r) c++;
    }
    cout << c << endl;
  }
  return 0;
}
