#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long int LINF = 0x3f3f3f3f3f3f3f3fll;
const int MOD = 1e9 + 7;
const long double pi = acos(-1);
int n;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  vector<int> v(n + 1, 0);
  for (int i = 1; i <= n; i++) cin >> v[i];
  int even = 0, odd = 0;
  for (int i = 1; i <= n; i++)
    if (i % 2 == 0)
      even += v[i];
    else
      odd += v[i];
  int cnt = 0;
  int last_even = 0, last_odd = 0;
  int even_ = even, odd_ = odd;
  for (int i = 1; i <= n; i++) {
    if (i % 2 == 0) {
      even_ -= v[i];
      if (last_even + odd_ == last_odd + even_) cnt++;
      last_even += v[i];
    } else {
      odd_ -= v[i];
      if (last_even + odd_ == last_odd + even_) cnt++;
      last_odd += v[i];
    }
  }
  cout << cnt << endl;
  return 0;
}
