#include <bits/stdc++.h>
using namespace std;
int arr[200009];
int prefix[200009];
int suffix[200009];
int res[2];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  for (int i = n; i >= 1; i--) {
    suffix[i] = arr[i] + suffix[i + 2];
  }
  for (int i = 1; i <= n; i++) {
    if ((i - 2) < 0) {
      prefix[i] = arr[i];
    } else {
      prefix[i] = arr[i] + prefix[i - 2];
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    res[0] = res[1] = 0;
    if ((i - 1) > 0) {
      res[(i - 1) % 2] = (res[(i - 1) % 2] + prefix[i - 1]);
    }
    if ((i - 2) > 0) {
      res[(i - 2) % 2] = (res[(i - 2) % 2] + prefix[i - 2]);
    }
    res[(i) % 2] += suffix[i + 1];
    res[(i + 1) % 2] += suffix[i + 2];
    if (res[0] == res[1]) {
      ans++;
    }
  }
  cout << ans << endl;
}
