#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
constexpr ll inf = 0x3FFFFFFFFFFF;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  ll n;
  cin >> n;
  vector<vector<ll>> pref(2, vector<ll>(n + 1));
  for (ll i = 0; i < n; i++) {
    ll x;
    cin >> x;
    pref[0][i + 1] = pref[0][i];
    pref[1][i + 1] = pref[1][i];
    pref[i % 2][i + 1] += x;
  }
  ll res = 0;
  for (ll i = 0; i < n; i++) {
    if (pref[0][i] + pref[1][n] - pref[1][i + 1] ==
        pref[1][i] + pref[0][n] - pref[0][i + 1]) {
      res++;
    }
  }
  cout << res << endl;
}
