#include <bits/stdc++.h>
using namespace std;
const int M = 1e6, N = 2 * (1e5 + 20), MOD = 1e9 + 7, OO = 1e16;
long long m, n, k, x, y, vis[N], bla, c = 1, cnt, ans, a[N], preEven[N],
                                      preOdd[N];
pair<int, int> p[N];
vector<int> v;
set<long long> ss;
string s, t;
vector<vector<int> > G;
int main() {
  cin >> n;
  long long even = 0, odd = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (i % 2) {
      preOdd[i] = preOdd[i - 1] + a[i];
      preEven[i] = preEven[i - 1];
    } else
      preEven[i] = preEven[i - 1] + a[i], preOdd[i] = preOdd[i - 1];
  }
  for (int i = 1; i <= n; i++) {
    if ((i % 2)) {
      if (i > 1)
        odd = preOdd[i - 2] + (preEven[n] - preEven[i - 1]);
      else
        odd = preEven[n];
      even = preEven[i - 1] + (preOdd[n] - preOdd[i]);
      if (odd == even) ans++;
    } else {
      even = (preOdd[n] - preOdd[i - 1]) + preEven[i - 2];
      odd = preOdd[i - 1] + (preEven[n] - preEven[i]);
      if (even == odd) ans++;
    }
  }
  cout << ans;
}
