#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 5;
long int A[MAX];
long int odd[MAX], even[MAX];
long int revodd[MAX], reveven[MAX];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%ld", &A[i]);
  }
  odd[1] = A[1];
  even[1] = 0;
  for (int i = 2; i <= n; i++) {
    if (i & 1) {
      odd[i] = A[i] + odd[i - 2];
      even[i] = even[i - 1];
    } else {
      even[i] = A[i] + even[i - 2];
      odd[i] = odd[i - 1];
    }
  }
  if (n & 1) {
    revodd[n] = A[n];
  } else {
    reveven[n] = A[n];
  }
  for (int i = n - 1; i >= 1; i--) {
    if (i & 1) {
      revodd[i] = A[i] + revodd[i + 2];
      reveven[i] = reveven[i + 1];
    } else {
      reveven[i] = A[i] + reveven[i + 2];
      revodd[i] = revodd[i + 1];
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if ((odd[i - 1] + reveven[i + 1]) == (even[i - 1] + revodd[i + 1])) ans++;
  }
  cout << ans << "\n";
  return 0;
}
