#include <bits/stdc++.h>
using namespace std;
const int Max = 200010;
long long ji[Max];
long long ou[Max];
long long a[Max];
int main() {
  long long n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  a[0] = 0;
  for (int i = 1; i <= n; i++) {
    if (i % 2 == 1) {
      ji[i] = ji[i - 1] + a[i];
      ou[i] = ou[i - 1];
    } else {
      ou[i] = ou[i - 1] + a[i];
      ji[i] = ji[i - 1];
    }
  }
  long long num = 0;
  for (int i = 1; i <= n; i++) {
    long long jis = 0;
    long long ous = 0;
    long long sum = 0;
    if (i % 2) {
      jis = ji[i] - a[i] + ou[n] - ou[i];
      ous = ou[i] + ji[n] - ji[i];
      if (ous == jis) {
        num++;
      }
    } else {
      jis = ou[i] - a[i] + ji[n] - ji[i];
      ous = ji[i] + ou[n] - ou[i];
      if (ous == jis) num++;
    }
  }
  printf("%lld\n", num);
  return 0;
}
