#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC optimize("no-stack-protector,fast-math")
using namespace std;
const int N = 2e5 + 5, M = 3e2 + 5, MOD = 1e9 + 7;
int n, ans, ar[N], prefodd, prefev, sufodd, sufev;
vector<int> e, o;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", ar + i);
    (i & 1) ? sufodd += ar[i] : sufev += ar[i];
  }
  for (int i = 0; i < n; i++) {
    if (!(i & 1)) {
      sufev = sufev - ar[i];
    } else {
      sufodd = sufodd - ar[i];
    }
    if (prefev + sufodd == prefodd + sufev) ans++;
    if (!(i & 1)) {
      prefev += ar[i];
    } else {
      prefodd += ar[i];
    }
  }
  printf("%d", ans);
  return 0;
}
