#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  long long int evenSum = 0;
  long long int oddSum = 0;
  int k = 0;
  int count = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i != 0) {
      if (i % 2 == 0)
        evenSum += a[i];
      else
        oddSum += a[i];
    }
  }
  for (int i = 1; i < n; i++) {
    if (evenSum == oddSum) count++;
    if (i % 2 == 0) {
      evenSum -= a[i];
      evenSum += a[i - 1];
    } else {
      oddSum -= a[i];
      oddSum += a[i - 1];
    }
  }
  if (evenSum == oddSum) count++;
  cout << count << endl;
  return 0;
}
