#include <bits/stdc++.h>
using namespace std;
const int maxd = 1000000007, N = 100000;
const double pi = acos(-1.0);
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while ((ch < '0') || (ch > '9')) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ((ch >= '0') && (ch <= '9')) {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  return x * f;
}
int a[201000], n, ans = 0;
int main() {
  n = read();
  int s = 0, sum = 0, i;
  for (i = 1; i <= n; i++) {
    a[i] = read();
    if (i % 2 == 0)
      sum -= a[i];
    else
      sum += a[i];
  }
  for (i = 1; i <= n; i++) {
    if (i % 2 == 0)
      s -= a[i];
    else
      s += a[i];
    int f;
    if (i % 2 == 0)
      f = 1;
    else
      f = -1;
    if (s * 2 + a[i] * f - sum == 0) ans++;
  }
  cout << ans;
  return 0;
}
