#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  int n;
  scanf("%d", &n);
  vector<int> a(n);
  vector<int> evensum(n, 0), oddsum(n, 0);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < n; i++) {
    if (i % 2) {
      oddsum[i] = a[i];
    } else {
      evensum[i] = a[i];
    }
    if (i > 0) {
      oddsum[i] += oddsum[i - 1];
      evensum[i] += evensum[i - 1];
    }
  }
  int res = 0;
  for (int i = 0; i < n; i++) {
    int even = 0, odd = 0;
    if (i > 0) {
      even = evensum[i - 1];
      odd = oddsum[i - 1];
    }
    if (i + 1 < n) {
      even += oddsum[n - 1] - oddsum[i];
      odd += evensum[n - 1] - evensum[i];
    }
    if (even == odd) {
      res++;
    }
  }
  printf("%d\n", res);
  return 0;
}
