#include <bits/stdc++.h>
using namespace std;
using namespace std;
signed main() {
  long long int n, evesuff = 0, evepre = 0, oddsuff = 0, oddpre = 0;
  cin >> n;
  long long int arr[n];
  long long int ans = 0;
  for (long long int i = 0; i < n; i++) {
    cin >> arr[i];
    if (i % 2 == 0)
      oddsuff += arr[i];
    else
      evesuff += arr[i];
  }
  for (long long int i = 0; i < n; i++) {
    if (i % 2 != 0) {
      evesuff -= arr[i];
    } else {
      oddsuff -= arr[i];
    }
    if (evepre + oddsuff == evesuff + oddpre) {
      ans++;
    }
    if (i % 2 == 0) {
      oddpre += arr[i];
    } else {
      evepre += arr[i];
    }
  }
  cout << ans;
}
