#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, a[N];
int main() {
  cin >> n;
  int b[2] = {0}, c[2] = {0}, ans = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    b[i % 2] += a[i];
  }
  for (int i = 1; i <= n; i++) {
    c[i % 2] += a[i];
    b[i % 2] -= a[i];
    if (i % 2 == 1) {
      if (b[0] + c[1] - a[i] == b[1] + c[0]) ans++;
    } else {
      if (b[0] + c[1] == b[1] + c[0] - a[i]) ans++;
    }
  }
  cout << ans;
  return 0;
}
