#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL, INF = 1e9, LINF = 1e18, maxN = 1e5;
string decToBinary(int n) {
  string s = "";
  for (int i = 31; i >= 0; i--) {
    int k = n >> i;
    if (k & 1)
      s += '1';
    else
      s += '0';
  }
  return s;
}
long long GT(int x) { return (x <= 1) ? 1 : x * GT(x - 1); }
long long tohop(long long n, long long k) {
  long long c = 1;
  for (long long i = 1; i <= k; i++, n--) c = c * n / i;
  return c;
}
bool isPrime(int n) {
  for (int i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
long long BSearch(long long a[], long long n, long long x) {
  long long l = 1;
  long long r = n;
  long long mid;
  while (l <= r) {
    mid = (l + r) / 2;
    if (x == a[mid])
      return mid;
    else if (x < a[mid])
      r = mid--;
    else if (x > a[mid])
      l = mid++;
  }
  return -1;
}
int top, bot;
int subArraySum(vector<long long> a, long long n, long long sum) {
  long long curr_sum = a[0], st = 0;
  for (long long i = 1; i <= n; i++) {
    while (curr_sum > sum && st < i - 1) {
      curr_sum = curr_sum - a[st];
      st++;
    }
    if (curr_sum == sum) {
      top = st + 1;
      bot = i;
      return 1;
    }
    if (i < n) curr_sum = curr_sum + a[i];
  }
  return 0;
}
struct data {
  long long x, y;
};
bool cmp(data a, data b) { return a.x < b.x; }
void solve() {
  long long n, even = 0, odd = 0, tmpev = 0, tmpod = 0, ans = 0;
  cin >> n;
  int a[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (i % 2 == 0)
      even += a[i];
    else
      odd += a[i];
  }
  for (int i = 1; i <= n; i++) {
    long long ev = even, od = odd;
    if (i % 2 == 0) {
      ev = ev - a[i] - tmpev;
      od -= tmpod;
      if (tmpev + od == tmpod + ev) ans++;
      tmpev += a[i];
    } else {
      od = od - a[i] - tmpod;
      ev -= tmpev;
      if (tmpev + od == tmpod + ev) ans++;
      tmpod += a[i];
    }
  }
  cout << ans << endl;
  return;
}
int main() {
  solve();
  return 0;
}
