#include <bits/stdc++.h>
using namespace std;
int even[0x3f3f3f], odd[0x3f3f3f], a[0x3f3f3f];
int main() {
  int n, i, sum = 0, ie = 0, io = 0;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    if (i % 2 == 0) {
      even[i] = even[i - 1] + a[i];
      odd[i] = odd[i - 1];
    } else {
      odd[i] = odd[i - 1] + a[i];
      even[i] = even[i - 1];
    }
  }
  for (i = 1; i <= n; i++)
    if (odd[i - 1] + even[n] - even[i] == even[i - 1] + odd[n] - odd[i]) sum++;
  cout << sum;
  return 0;
}
