#include <bits/stdc++.h>
using namespace std;
const int M = 2e5 + 10;
int x[M], a[M], b[M], n;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
  }
  for (int i = n; i >= 1; i--) {
    a[i] = a[i + 1];
    b[i] = b[i + 1];
    if (i % 2 == 0)
      a[i] += x[i];
    else
      b[i] += x[i];
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int ans1 = a[1] - a[i];
    int ans2 = b[1] - b[i];
    ans1 += b[i + 1];
    ans2 += a[i + 1];
    if (ans1 == ans2) ans++;
  }
  cout << ans << endl;
  return 0;
}
