#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0, sum = 0, i, count = 0, s1, s2, s3, s4;
  scanf("%d", &n);
  int even[n + 5], odd[n + 5], a[n + 5];
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  odd[0] = 0;
  even[0] = 0;
  for (i = 1; i <= n; i++) sum += a[i];
  for (i = 1; i <= n; i++) {
    if (i % 2 == 1) {
      odd[i] = odd[i - 1] + a[i];
    } else {
      odd[i] = odd[i - 1];
    }
    if (i % 2 == 0) {
      even[i] = even[i - 1] + a[i];
    } else {
      even[i] = even[i - 1];
    }
  }
  for (i = 1; i <= n; i++) {
    if ((sum - a[i]) % 2 == 0) {
      s2 = odd[i - 1];
      s3 = odd[n] - odd[i];
      s1 = even[n] - even[i];
      s4 = even[i - 1];
      if (s1 + s2 == s3 + s4) count++;
    }
  }
  printf("%d", count);
}
