#include <bits/stdc++.h>
using namespace std;
void scanVect(vector<long long unsigned> &arr, long long unsigned n) {
  for (int i = 0; i < n; i++) cin >> arr[i];
}
void printArr(int *arr, int n) {
  for (int i = 0; i < n; i++) cout << arr[i] << " ";
  printf("\n");
}
void printVect(vector<long long unsigned> &arr) {
  for (auto x : arr) cout << x << " ";
  cout << endl;
}
int max(int a, int b) {
  if (a > b) return a;
  return b;
}
int min(int a, int b) {
  if (a < b) return a;
  return b;
}
int solve(vector<long long unsigned> arr, long long unsigned n) {
  long long unsigned s = 0;
  vector<long long unsigned> odd_pref(n), even_pref(n);
  odd_pref[0] = odd_pref[1] = arr[0];
  even_pref[1] = arr[1];
  for (int i = 2; i < n; i += 2) {
    odd_pref[i] = odd_pref[i - 1] + arr[i];
    odd_pref[i + 1] = odd_pref[i];
  }
  for (int i = 1; i < n; i += 2) {
    even_pref[i] = even_pref[i - 1] + arr[i];
    even_pref[i + 1] = even_pref[i];
  }
  for (int i = 0; i < n; i++) {
    long long unsigned odd_part = 0;
    long long unsigned even_part = 0;
    odd_part =
        ((i > 0) ? odd_pref[i - 1] : 0) + even_pref[n - 1] - even_pref[i];
    even_part =
        ((i > 0) ? even_pref[i - 1] : 0) + odd_pref[n - 1] - odd_pref[i];
    if (odd_part == even_part) s++;
  }
  return s;
}
int main(int argc, const char *argv[]) {
  int t = 1;
  while (t--) {
    long long unsigned n;
    cin >> n;
    vector<long long unsigned> arr(n);
    scanVect(arr, n);
    cout << solve(arr, n) << endl;
  }
  return 0;
}
