#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int arr[n];
  long long int even = 0, odd = 0, count = 0;
  cin >> arr[0];
  for (int i = 1; i < n; i++) {
    cin >> arr[i];
    if (i % 2 == 0)
      even = even + arr[i];
    else
      odd = odd + arr[i];
  }
  if (even == odd) count = count + 1;
  for (int i = 1; i < n; i++) {
    if (i % 2 == 0) {
      even = even - arr[i];
      even = even + arr[i - 1];
    } else {
      odd = odd - arr[i];
      odd = odd + arr[i - 1];
    }
    if (odd == even) count = count + 1;
  }
  cout << count << endl;
  return (0);
}
