#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> A(n);
  pair<int, int> place;
  place.first = 0;
  place.second = 0;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    if (i % 2 == 0)
      place.second += A[i];
    else
      place.first += A[i];
  }
  if (n % 2 == 1)
    place.second -= A[0];
  else
    place.second -= A[0];
  int cnt = 0;
  for (int i = 0; i < n - 1; i++) {
    if (place.first == place.second) cnt++;
    if (i % 2 == 0)
      place.first -= (A[i + 1] - A[i]);
    else
      place.second -= (A[i + 1] - A[i]);
  }
  if (place.first == place.second) cnt++;
  cout << cnt << endl;
  return 0;
}
