#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, c = 0, s1, s2;
  cin >> n;
  cout << "\n";
  int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  cout << "\n";
  s1 = 0;
  s2 = 0;
  for (i = 1; i < n; i++) {
    if (i % 2 != 0)
      s1 = s1 + a[i];
    else
      s2 = s2 + a[i];
  }
  if (s1 == s2) c++;
  for (i = 1; i < n; i++) {
    if (i % 2 != 0) {
      s1 = s1 - a[i] + a[i - 1];
    } else {
      s2 = s2 - a[i] + a[i - 1];
    }
    if (s1 == s2) c++;
  }
  cout << c << endl;
}
