#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  long long a[2 * 100005];
  long long sumE = 0, sumO = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (i & 1)
      sumO += a[i];
    else
      sumE += a[i];
  }
  vector<long long> po, pe;
  po.push_back(0);
  pe.push_back(0);
  for (int i = 1; i <= n; i++) {
    if (i & 1) {
      if (po.size() == 0)
        po.push_back(a[i]);
      else
        po.push_back(a[i] + po.back());
      pe.push_back(pe.back());
    } else {
      if (pe.size() == 0)
        pe.push_back(a[i]);
      else
        pe.push_back(a[i] + pe.back());
      po.push_back(po.back());
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (pe[i - 1] + sumO - po[i] == po[i - 1] + sumE - pe[i]) ans++;
  }
  cout << ans << endl;
  return 0;
}
