#include <bits/stdc++.h>
using namespace std;
void io() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
}
const long long INF = 1e9;
signed main() {
  io();
  int n;
  cin >> n;
  vector<long long> a(n + 1);
  for (int i = 1; i <= n; i++) cin >> a[i];
  long long even = 0, odd = 0;
  vector<long long> oddsum(n + 1, 0), evensum(n + 1, 0);
  for (int i = 1; i <= n; i++) {
    if (i % 2 == 1) {
      oddsum[i] += a[i];
    }
    if (i % 2 == 0) evensum[i] += a[i];
    oddsum[i] += oddsum[i - 1];
    evensum[i] += evensum[i - 1];
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    if (oddsum[i - 1] + (evensum[n] - evensum[i]) ==
        evensum[i - 1] + (oddsum[n] - oddsum[i]))
      ans++;
  }
  cout << ans;
  return 0;
}
