#include <bits/stdc++.h>
using namespace std;
long long fx[4] = {1, -1, 0, 0};
long long fy[4] = {0, 0, 1, -1};
long long ox8[] = {0, 0, 1, 1, 1, -1, -1, -1};
long long oy8[] = {1, -1, 1, -1, 0, 0, -1, 1};
bool sort2val(const pair<int, int> &a, const pair<int, int> &b) {
  if (a.second == b.second) return a.first < b.first;
  return a.second < b.second;
}
template <class T>
T gcd(T a, T b) {
  return (b != 0 ? gcd<T>(b, a % b) : a);
}
template <class T>
T lcm(T a, T b) {
  return (a / gcd<T>(a, b) * b);
}
long long pw(long long a, long long b) {
  long long ans = 1;
  for (long long i = 1; i <= b; ++i) ans = (ans * a);
  return ans;
}
template <class T>
inline T bigmod(T n, T p, T m) {
  if (p == 0)
    return 1;
  else if (p % 2 == 0) {
    long long val = bigmod(n, p / 2, m);
    return (T)((val * val) % m);
  } else
    return (T)(((long long)n * (long long)bigmod(n, p - 1, m)) % m);
}
int main() {
  {
    long long n, od = 0, ev = 0;
    cin >> n;
    long long a[n + 6], b[n + 6];
    memset(a, 0, sizeof(a));
    ;
    memset(b, 0, sizeof(b));
    ;
    for (int i = 2; i <= n + 1; i++) {
      cin >> a[i];
      b[i] = a[i];
    }
    for (int i = 2; i <= n + 3; i++) a[i] += a[i - 2];
    for (long long i = n + 1; i >= 0; i--) b[i] += b[i + 2];
    long long cr_h = 0;
    for (int i = 2; i <= n + 1; i++) {
      long long ek = a[i - 1] + b[i + 2];
      long long dui = a[i - 2] + b[i + 1];
      if (ek == dui) cr_h++;
    }
    cout << cr_h << "\n";
  }
  return 0;
}
