#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200100;
long long v[MAXN];
pair<long long, long long> p[MAXN], s[MAXN];
signed main() {
  memset(p, 0, sizeof p);
  memset(s, 0, sizeof s);
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> v[i];
  for (long long i = 1; i <= n; i++) {
    p[i] = p[i - 1];
    if (i % 2 == 0)
      p[i].first += v[i];
    else
      p[i].second += v[i];
  }
  for (long long i = n; i >= 1; i--) {
    s[i] = s[i + 1];
    if (i % 2 == 0)
      s[i].first += v[i];
    else
      s[i].second += v[i];
  }
  long long resp = 0;
  for (long long i = 1; i <= n; i++) {
    if (p[i - 1].first + s[i + 1].second == p[i - 1].second + s[i + 1].first) {
      resp++;
    }
  }
  cout << resp << endl;
}
