#include <bits/stdc++.h>
using namespace std;
int n, i, x, c, a[222000], b[222000];
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> x;
    a[i] = (i % 2 == 1) * x + a[i - 1];
    b[i] = (i % 2 == 0) * x + b[i - 1];
  }
  for (i = 1; i <= n; i++) {
    c += (b[n] - b[i] + a[i - 1]) == (a[n] - a[i] + b[i - 1]);
  }
  cout << c;
}
