#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 25, M = 1e6 + 25, oo = 1e9 + 7, mxmsk = 1 << 16;
const long long OO = 1e18 + 25;
unsigned int n, a[N], odd, even, odd1, even1, c;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    if (i & 1)
      odd += a[i];
    else
      even += a[i];
  }
  for (int i = 1; i <= n; i++) {
    if (i & 1)
      odd -= a[i];
    else
      even -= a[i];
    ;
    if (odd + even1 == odd1 + even) c++;
    if (i & 1)
      odd1 += a[i];
    else
      even1 += a[i];
  }
  printf("%d\n", c);
  return 0;
}
