#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
int a[200020], n;
long long pre[200020][2];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    pre[i][0] = pre[i - 1][0];
    pre[i][1] = pre[i - 1][1];
    pre[i][i % 2] += a[i];
  }
  int ans = 0;
  long long even = 0, odd = 0;
  for (int i = 1; i <= n; ++i) {
    even = pre[i - 1][0] + pre[n][1] - pre[i][1];
    odd = pre[i - 1][1] + pre[n][0] - pre[i][0];
    if (odd == even) ans++;
  }
  cout << ans << endl;
  return 0;
}
