#include <bits/stdc++.h>
using namespace std;
struct piii {
  int first, second, th;
  piii(int f = 0, int s = 0, int t = 0) : first(f), second(s), th(t) {}
  bool operator<(piii b) {
    return first != b.first     ? first < b.first
           : second != b.second ? second < b.second
                                : th < b.th;
  }
};
const long double PI = acos(-1);
const long long INF = 1e18, MOD = 1000000007;
signed main() {
  ios::sync_with_stdio(0), cin.tie(0);
  long long n, a[200000 + 1] = {}, pre[2] = {}, suf[2] = {}, cnt = 0;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i], suf[i & 1] += a[i];
  for (int i = 0; i < n; i++) {
    suf[i & 1] -= a[i];
    if (pre[1] + suf[0] == pre[0] + suf[1]) cnt++;
    pre[i & 1] += a[i];
  }
  cout << cnt << '\n';
}
