#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, even = 0, odd = 0;
  cin >> n;
  long long int A[n + 1];
  for (long long int i = 1; i <= n; i++) {
    cin >> A[i];
    if (i % 2 == 0)
      even += A[i];
    else
      odd += A[i];
  }
  long long int oddcurr = 0, evencurr = 0, dumodd, dumeven, cnt = 0;
  for (long long int i = 1; i <= n; i++) {
    dumodd = odd;
    dumeven = even;
    if (i % 2 == 0) {
      dumeven -= A[i];
      dumodd -= oddcurr;
      dumeven += oddcurr;
      dumodd += evencurr;
      dumeven -= evencurr;
      if (dumeven == dumodd) cnt++;
      evencurr += A[i];
    } else {
      dumodd -= A[i];
      dumodd -= oddcurr;
      dumeven += oddcurr;
      dumodd += evencurr;
      dumeven -= evencurr;
      if (dumeven == dumodd) cnt++;
      oddcurr += A[i];
    }
  }
  cout << cnt;
}
