#include <bits/stdc++.h>
using namespace std;
long long int a[400000];
int main() {
  long long int count = 0;
  int preo[400000] = {0};
  int pree[400000] = {0};
  int sufe[400000] = {0};
  int sufo[400000] = {0};
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  pree[0] = a[0];
  preo[0] = 0;
  for (int i = 1; i < n; i++) {
    if (i % 2 == 0) {
      pree[i] = pree[i - 1] + a[i];
      preo[i] = preo[i - 1];
    } else {
      pree[i] = pree[i - 1];
      preo[i] = preo[i - 1] + a[i];
    }
  }
  if ((n - 1) % 2 == 0) {
    sufe[n - 1] = a[n - 1];
    sufo[n - 1] = 0;
  } else {
    sufe[n - 1] = 0;
    sufo[n - 1] = a[n - 1];
  }
  for (int i = n - 2; i >= 0; i--) {
    if (i % 2 == 0) {
      sufe[i] = sufe[i + 1] + a[i];
      sufo[i] = sufo[i + 1];
    } else {
      sufe[i] = sufe[i + 1];
      sufo[i] = sufo[i + 1] + a[i];
    }
  }
  vector<int> v;
  for (int k = 0; k < n; k++) {
    if (k == 0) {
      if (pree[n - 1] - a[0] == preo[n - 1]) {
        count++;
        v.push_back(k);
      }
    } else if (k == n - 1) {
      if (pree[n - 2] == preo[n - 2]) {
        count++;
        v.push_back(k);
      }
    } else if (pree[k - 1] + sufo[k + 1] == preo[k - 1] + sufe[k + 1]) {
      count++;
      v.push_back(k);
    }
  }
  cout << count << endl;
}
