#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long N = 100311;
long long binpow(long long x, long long y) {
  if (y == 0) return 1;
  if (y == 1)
    return x % mod;
  else if (y % 2 == 0) {
    long long w = binpow(x, y / 2) % mod;
    return (w * w) % mod;
  } else
    return ((x % mod) * (binpow(x, y - 1) % mod)) % mod;
}
bool check(string s1, string s2) {
  if (s1[1] == s2[1] && abs((s1[0] - '0') - (s2[0] - '0')) <= 2)
    return true;
  else
    return false;
}
long long a[200000 + 10];
long long pref2[200000 + 10];
long long pref1[200000 + 10];
long long suf2[200000 + 10];
long long suf1[200000 + 10];
int main() {
  long long t = 1;
  while (t--) {
    long long n, ans = 0;
    cin >> n;
    for (long long i = 1; i <= n; i++) cin >> a[i];
    for (long long i = 1; i <= n; i++) {
      if (i % 2 == 1) {
        pref1[i] = pref1[i - 1] + a[i];
        pref2[i] = pref2[i - 1];
      } else {
        pref2[i] = pref2[i - 1] + a[i];
        pref1[i] = pref1[i - 1];
      }
    }
    for (long long i = n; i >= 1; i--) {
      if (i % 2 == 1) {
        suf1[i] = suf1[i + 1] + a[i];
        suf2[i] = suf2[i + 1];
      } else {
        suf2[i] = suf2[i + 1] + a[i];
        suf1[i] = suf1[i + 1];
      }
    }
    for (long long i = 1; i <= n; i++) {
      long long sum1 = 0;
      long long sum2 = 0;
      sum1 += pref1[i - 1];
      sum2 += pref2[i - 1];
      sum1 += suf2[i + 1];
      sum2 += suf1[i + 1];
      if (sum1 == sum2) ans++;
    }
    cout << ans << "\n";
  }
}
