#include <bits/stdc++.h>
using namespace std;
long long a[200000 + 5];
pair<long long, long long> b[200000 + 5];
int main() {
  long long N, ans = 0;
  cin >> N;
  for (int i = 1; i <= N; i++) {
    cin >> a[i];
    if (i % 2) {
      b[i].first = b[i - 1].first;
      b[i].second = b[i - 1].second + a[i];
    } else {
      b[i].first = b[i - 1].first + a[i];
      b[i].second = b[i - 1].second;
    }
  }
  for (int i = 1; i <= N; i++) {
    long long odd, even;
    odd = b[i - 1].first + (b[N].second - b[i].second);
    even = b[i - 1].second + (b[N].first - b[i].first);
    if (even == odd) ans++;
  }
  cout << ans;
  return 0;
}
