#include <bits/stdc++.h>
using namespace std;
long long a[1000007];
long long b[1000007];
long long has[1000007];
long long dp2[1000007], has1[5000005];
std::vector<long long> v1, v2;
long long fastpow(long long n, long long r) {
  if (r == 0) return 1;
  if (r == 1) return n;
  long long hr = fastpow(n, r / 2);
  if (r & 1)
    return (((hr * hr) % 998244353) * n) % 998244353;
  else
    return (hr * hr) % 998244353;
}
long long addmod(long long n, long long m) {
  return ((n % 998244353) + (m % 998244353)) % 998244353;
}
long long multmod(long long n, long long m) {
  return ((n % 998244353) * (m % 998244353)) % 998244353;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long odd[10000005], eve[10000005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> a[i];
  odd[0] = a[0];
  eve[1] = a[1];
  for (long long i = 1; i < n; i += 2) {
    odd[i] = odd[i - 1];
    odd[i + 1] = odd[i - 1] + a[i + 1];
  }
  for (long long i = 2; i < n; i += 2) {
    eve[i] = eve[i - 1];
    eve[i + 1] = eve[i - 1] + a[i + 1];
  }
  long long sum1 = 0, sum2 = 0, cnt = 0;
  for (long long i = 0; i < n; i++) {
    sum1 = 0;
    sum2 = 0;
    if (!(i & 1)) {
      sum1 = odd[i - 1];
      sum1 += eve[n - 1] - eve[i - 1];
      sum2 = eve[i - 1];
      if (i < n - 1) sum2 += odd[n - 1] - odd[i + 1];
      if (sum1 == sum2) cnt++;
    } else {
      sum1 = eve[i - 1];
      sum1 += odd[n - 1] - odd[i - 1];
      sum2 = odd[i - 1];
      if (i < n - 1) sum2 += eve[n - 1] - eve[i + 1];
      if (sum1 == sum2) cnt++;
    }
  }
  cout << cnt;
  return 0;
}
