#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int count = 0;
  unsigned long long a = 0, b = 0, temp = 0;
  cin >> n;
  int nArr[2 * 100000];
  for (int i = 0; i < n; i++) {
    cin >> nArr[i];
  }
  for (int i = 1; i < n; i++) {
    if (i % 2 == 0)
      a += nArr[i];
    else
      b += nArr[i];
  }
  for (int j = 1; j < n; j++) {
    if (a == b) count++;
    b = b + nArr[j - 1] - nArr[j];
    temp = a;
    a = b;
    b = temp;
  }
  if (a == b) count++;
  cout << count;
}
