#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(NULL);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int a;
  vector<int> v;
  v.push_back(0);
  for (int i = 0; i < n; i++) {
    cin >> a;
    v.push_back(a);
  }
  int f1 = 0, f2 = 0, b1 = 0, b2 = 0;
  for (int i = 1; i <= n; i++) {
    b2 += v[i];
    i++;
  }
  for (int i = 2; i <= n; i++) {
    b1 += v[i];
    i++;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (i % 2 == 0)
      b1 = b1 - v[i] + v[i - 1];
    else
      b2 = b2 - v[i] + v[i - 1];
    if (b1 == b2) ans++;
  }
  cout << ans;
  return 0;
}
