#include <bits/stdc++.h>
using namespace std;
vector<long long> odd(10000001);
vector<long long> even(10000001);
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ifstream f1;
  f1.open("INP.txt");
  ofstream f2;
  f2.open("OUT.txt");
  long long n;
  cin >> n;
  vector<long long> candy(n + 1);
  for (long long i = 1; i <= n; i++) {
    cin >> candy[i];
  }
  for (long long i = 1; i <= n; i++) {
    if (i % 2 == 0) {
      even[i] = candy[i];
    } else {
      odd[i] = candy[i];
    }
  }
  long long oddSum = accumulate(odd.begin(), odd.end(), 0);
  long long oddAl = 0;
  long long evenSum = accumulate(even.begin(), even.end(), 0);
  long long evenAl = 0;
  long long count = 0;
  for (long long i = 1; i <= n; i++) {
    if (i % 2 != 0) {
      long long sum1 = oddSum - oddAl - odd[i];
      long long sum2 = evenSum - evenAl;
      sum1 += evenAl;
      sum2 += oddAl;
      if (sum1 == sum2) {
        count++;
      }
      oddAl += candy[i];
    } else {
      long long sum1 = oddSum - oddAl;
      long long sum2 = evenSum - evenAl - even[i];
      sum1 += evenAl;
      sum2 += oddAl;
      if (sum1 == sum2) {
        count++;
      }
      evenAl += candy[i];
    }
  }
  cout << count << endl;
  return 0;
}
