#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n;
int even[N] = {0}, odd[N] = {0};
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int u;
    scanf("%d", &u);
    even[i] = even[i - 1] + (i & 1 ? 0 : u);
    odd[i] = odd[i - 1] + (i & 1 ? u : 0);
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (i & 1) {
      int od = odd[i - 1] + even[n] - even[i];
      int ev = even[i] + odd[n] - odd[i];
      if (od == ev) ans++;
    } else {
      int od = odd[i] + even[n] - even[i];
      int ev = even[i - 1] + odd[n] - odd[i];
      if (od == ev) ans++;
    }
  }
  printf("%d\n", ans);
}
