#include <bits/stdc++.h>
using namespace ::std;
template <class T>
istream& operator>>(istream& I, vector<T>& v) {
  for (T& e : v) I >> e;
  return I;
}
template <class T>
ostream& operator<<(ostream& O, const vector<T>& v) {
  for (const T& e : v) O << e << ' ';
  cout << '\n';
  return O;
}
void _main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << 1;
    return;
  }
  vector<int> vec(n);
  cin >> vec;
  vector<pair<int, int>> pre(n), suf(n);
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      if (i - 1 >= 0) pre[i].second = pre[i - 1].second;
      pre[i].first = vec[i];
      if (i - 2 >= 0) pre[i].first += pre[i - 2].first;
    } else {
      if (i - 1 >= 0) pre[i].first = pre[i - 1].first;
      pre[i].second = vec[i];
      if (i - 2 >= 0) pre[i].second += pre[i - 2].second;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (i % 2 == 0) {
      if (i + 1 < n) suf[i].second = suf[i + 1].second;
      suf[i].first = vec[i];
      if (i + 2 < n) suf[i].first += suf[i + 2].first;
    } else {
      if (i + 1 < n) suf[i].first = suf[i + 1].first;
      suf[i].second = vec[i];
      if (i + 2 < n) suf[i].second += suf[i + 2].second;
    }
  }
  int ans = 0;
  if (suf[1].first == suf[1].second) ans++;
  if (pre[n - 2].first == pre[n - 2].second) ans++;
  for (int del = 1; del + 1 < n; del++) {
    if (pre[del - 1].first + suf[del + 1].second ==
        pre[del - 1].second + suf[del + 1].first)
      ans++;
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int _t = 1;
  while (_t--) _main();
  return 0;
}
