#include <bits/stdc++.h>
using namespace std;
const long long INF = 2 * 1e10;
const long long MOD = 1e10 + 9;
const long long B = 53;
int main() {
  ifstream inp("input.txt");
  ofstream outp("output.txt");
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  long long second = 0;
  vector<long long> m(n);
  for (long long i = 0; i < n; i++) {
    cin >> m[i];
  }
  long long snc = 0, sch = 0;
  for (long long i = 0; i < n; i++) {
    if (i % 2 == 0) {
      sch += m[i];
    } else {
      snc += m[i];
    }
  }
  long long tsch = 0, tsnc = 0;
  for (long long i = 0; i < n; i++) {
    if (i % 2 == 0) {
      long long ta = tsch - tsnc + snc;
      long long tb = tsnc + sch - m[i] - tsch;
      if (ta == tb) second++;
      tsch += m[i];
    } else {
      long long ta = tsnc - tsch + sch;
      long long tb = tsch + snc - m[i] - tsnc;
      if (ta == tb) second++;
      tsnc += m[i];
    }
  }
  cout << second;
  return 0;
}
