#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  int sum = 0, sum1 = 0;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    if (i % 2)
      sum += v[i];
    else
      sum1 += v[i];
  }
  long long c = 0, sum2 = 0, sum3 = 0;
  for (int i = 0; i < n; i++) {
    if (i % 2) {
      sum -= v[i];
      if (sum1 + sum2 == sum3 + sum) c++;
      sum2 += v[i];
    } else if (i % 2 == 0) {
      sum1 -= v[i];
      if (sum1 + sum2 == sum3 + sum) c++;
      sum3 += v[i];
    }
  }
  cout << c << endl;
  return 0;
}
