#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  if (n == 1) {
    printf("1\n");
    return 0;
  }
  int *mas = new int[n], ans = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &mas[i]);
  }
  int *pre1 = new int[n], *pre2 = new int[n], *suf1 = new int[n],
      *suf2 = new int[n];
  pre1[0] = mas[0];
  pre2[0] = 0;
  for (int i = 1; i < n; ++i) {
    pre1[i] = pre1[i - 1];
    pre2[i] = pre2[i - 1];
    if (i & 1) {
      pre2[i] += mas[i];
    } else {
      pre1[i] += mas[i];
    }
  }
  suf1[n - 1] = mas[n - 1];
  suf2[n - 1] = 0;
  for (int i = n - 2; i >= 0; --i) {
    suf1[i] = suf2[i + 1] + mas[i];
    suf2[i] = suf1[i + 1];
  }
  ans += (suf1[1] == suf2[1] ? 1 : 0);
  ans += (pre1[n - 2] == pre2[n - 2] ? 1 : 0);
  for (int i = 1; i < n - 1; ++i) {
    if (i & 1) {
      ans +=
          ((pre1[i - 1] + suf2[i + 1]) == (pre2[i - 1] + suf1[i + 1]) ? 1 : 0);
    } else {
      ans +=
          ((pre1[i - 1] + suf1[i + 1]) == (pre2[i - 1] + suf2[i + 1]) ? 1 : 0);
    }
  }
  printf("%d\n", ans);
  return 0;
}
