#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, num;
  vector<long long int> odd, even;
  cin >> n;
  even.push_back(0);
  odd.push_back(0);
  bool f = 1;
  while (n--) {
    cin >> num;
    if (f) {
      even.push_back(even[even.size() - 1] + num);
      odd.push_back(odd[odd.size() - 1]);
    } else {
      odd.push_back(odd[odd.size() - 1] + num);
      even.push_back(even[even.size() - 1]);
    }
    f = !f;
  }
  long long int ans = 0;
  for (int i = 1; i < even.size(); i++) {
    long long int a = even[i - 1] + (odd[odd.size() - 1] - odd[i]);
    long long int b = odd[i - 1] + (even[even.size() - 1] - even[i]);
    if (a == b) ans++;
  }
  cout << ans << endl;
  return 0;
}
