#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  int *arr = new int[n + 1];
  long long sm1 = 0;
  long long sm2 = 0;
  long long arreve[n + 1];
  long long arrod[n + 1];
  arreve[0] = 0;
  arrod[0] = 0;
  for (int i = 1; i <= n; ++i) {
    cin >> arr[i];
    if (i & 1) {
      sm1 += arr[i];
      arrod[i] = sm1;
    } else {
      sm2 += arr[i];
      arreve[i] = sm2;
    }
  }
  long long x = 0, y = 0;
  int cnt = 0;
  for (int i = 1; i <= n; ++i) {
    if (i == 2) {
      x = arr[i - 1];
    }
    if (i >= 3) {
      if (i & 1)
        x = arrod[i - 2], y = arreve[i - 1];
      else
        x = arrod[i - 1], y = arreve[i - 2];
    }
    if (i & 1) {
      if (sm1 - x + y - arr[i] == sm2 - y + x) cnt++;
    }
    if (i % 2 == 0) {
      if (sm1 - x + y == sm2 - y - arr[i] + x) cnt++;
    }
  }
  cout << cnt;
  return 0;
}
