#include <bits/stdc++.h>
using namespace std;
void GO() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
}
const long long INF = 1e18;
const long long mod = 998244353;
const int maxn = (int)5e3 + 1;
const int maxd = 501;
const long double PI = acos(-1.0);
mt19937 rnd(time(0));
void solve() {
  long long n, ans = 0;
  cin >> n;
  vector<long long> a(n);
  for (auto &i : a) cin >> i;
  vector<long long> pref(n);
  pref[0] = a[0];
  for (int i = 0; i < n - 1; ++i)
    pref[i + 1] = (i & 1 ? a[i + 1] : -a[i + 1]) + pref[i];
  for (int i = 0; i < n; ++i) {
    long long one = (i ? pref[i - 1] : 0);
    long long two = (i + 1 < n ? pref.back() - pref[i] : 0);
    ans += !(one - two);
  }
  cout << ans;
}
signed main() {
  GO();
  int Q = 1;
  while (Q--) solve();
  return 0;
}
