#include <bits/stdc++.h>
using namespace std;
int main() {
  long long q, t, i, j, k, b, c, d, n, odd = 0, even = 0, odd2 = 0, even2 = 0;
  cin >> n;
  long long a[n + 2];
  c = 0;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    if (i % 2 == 0)
      even += a[i];
    else
      odd += a[i];
  }
  for (i = 1; i <= n; i++) {
    if (i % 2 == 1) {
      swap(odd, even);
      even = even - a[i];
      if (odd2 + odd == even2 + even) ++c;
      swap(odd, even);
      odd2 += a[i];
    } else {
      swap(odd, even);
      odd = odd - a[i];
      if (odd2 + odd == even2 + even) ++c;
      swap(odd, even);
      even2 += a[i];
    }
  }
  cout << c << endl;
}
