#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
const int INF = 1e9 + 7;
const int BIGD = 1e8 + 1;
const int ten6 = 1e6;
void optimize() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int a[MAXN], n;
int pref[MAXN], pref2[MAXN], res;
int main() {
  optimize();
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (i % 2 == 0) {
      pref2[i] = pref2[i - 1] + a[i];
      pref[i] = pref[i - 1];
    } else {
      pref[i] = pref[i - 1] + a[i];
      pref2[i] = pref2[i - 1];
    }
  }
  for (int i = 1; i <= n; i++) {
    int sum1 = pref[i - 1] + (pref2[n] - pref2[i]);
    int sum2 = pref2[i - 1] + (pref[n] - pref[i]);
    if (sum1 == sum2) res++;
  }
  cout << res;
  return 0;
}
