#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf(" %d", &n);
  int odd[200000] = {0}, even[200000] = {0}, a[200010], os = 1, es = 1;
  for (int i = 0; i < n; i++) {
    scanf(" %d", &a[i]);
    if (i % 2 == 0) {
      odd[os] = a[i] + odd[os - 1];
      os += 1;
    } else {
      even[es] = a[i] + even[es - 1];
      es += 1;
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      int od = odd[i / 2] + even[es - 1] - even[i / 2];
      int ev = odd[os - 1] - odd[i / 2 + 1] + even[i / 2];
      if (od == ev) ans += 1;
    } else {
      int od = odd[i / 2 + 1] + even[es - 1] - even[i / 2 + 1];
      int ev = even[i / 2] + odd[os - 1] - odd[i / 2 + 1];
      if (od == ev) ans += 1;
    }
  }
  printf("%d\n", ans);
  return 0;
}
