#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> w(n);
  int ePr = 0, oPr = 0, eS = 0, oS = 0;
  for (int i = 0; i < n; ++i) {
    cin >> w[i];
    if (i & 1)
      eS += w[i];
    else
      oS += w[i];
  }
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    if (i & 1)
      eS -= w[i];
    else
      oS -= w[i];
    if (ePr + oS == oPr + eS) {
      ++ans;
    }
    if (i & 1)
      ePr += w[i];
    else
      oPr += w[i];
  }
  cout << ans << endl;
}
int main() {
  solve();
  return 0;
}
