#include <bits/stdc++.h>
using namespace std;
int n;
int c[2 * 100005], a[100005], b[100005];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> c[i];
  }
  a[1] = c[1];
  b[1] = c[2];
  for (int i = 3; i <= n; i++) {
    if (i % 2)
      a[(i + 1) / 2] = a[(i - 1) / 2] + c[i];
    else
      b[(i + 1) / 2] = b[(i - 1) / 2] + c[i];
  }
  int counter = 0;
  for (int i = 1; i <= n; i++) {
    long aa = 0, bb = 0;
    if (i % 2) {
      aa = a[i / 2] + b[(n) / 2] - b[(i) / 2];
      bb = b[i / 2] + a[(n + 1) / 2] - a[i / 2 + 1];
    } else {
      aa = a[i / 2] + b[(n) / 2] - b[i / 2];
      bb = b[i / 2 - 1] + a[(n + 1) / 2] - a[(i + 1) / 2];
    }
    if (aa == bb) counter++;
  }
  cout << counter << endl;
}
