#include <bits/stdc++.h>
using namespace std;
void getData(int* array, int n) {
  for (int i = 0; i < n; i++) {
    cin >> array[i];
  }
}
void acumulate(int* array, long long* acumulate, int n) {
  long long even = 0, odd = 0;
  for (int i = 0; i < n; i++) {
    if ((i + 1) % 2) {
      odd += array[i];
      acumulate[i] = odd;
    } else {
      even += array[i];
      acumulate[i] = even;
    }
  }
}
long long* getMaxValues(long long* acumulated, int index, int n, int* array) {
  long long maxEven = n % 2 == 0 ? acumulated[n - 1] : acumulated[n - 2],
            maxOdd = n % 2 == 1 ? acumulated[n - 1] : acumulated[n - 2];
  if (index % 2 == 0)
    maxOdd -= array[index];
  else
    maxEven -= array[index];
  auto* ar = new long long[2];
  ar[0] = maxOdd;
  ar[1] = maxEven;
  return ar;
}
int main() {
  int n;
  cin >> n;
  int* array = new int[n];
  auto* acumulated = new long long[n];
  int goodCandies = 0;
  getData(array, n);
  acumulate(array, acumulated, n);
  if (n == 1)
    cout << 1 << endl;
  else {
    for (int i = 0; i < n; i++) {
      long long evenAcumulated = 0, oddAcumulated = 0;
      bool evenLast = i % 2 == 0;
      if (i > 0) {
        if (evenLast)
          evenAcumulated = acumulated[i - 1];
        else
          oddAcumulated = acumulated[i - 1];
      }
      if (i > 1) {
        if (!evenLast)
          evenAcumulated = acumulated[i - 2];
        else
          oddAcumulated = acumulated[i - 2];
      }
      auto* maxValues = getMaxValues(acumulated, i, n, array);
      maxValues[0] -= oddAcumulated;
      maxValues[1] -= evenAcumulated;
      if (evenAcumulated + maxValues[0] == oddAcumulated + maxValues[1])
        goodCandies++;
    }
    cout << goodCandies << endl;
  }
}
