#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
class Solution {
  int n;
  vector<int> A;
  vector<long long> pre[2];

 public:
  void run() {
    cin >> n;
    A.resize(n);
    for (int i = 0; i < n; ++i) cin >> A[i];
    for (int i = 0; i < 2; ++i) {
      pre[i].resize(n + 1);
    }
    for (int i = 0; i < n; ++i) {
      for (int j : {0, 1}) {
        pre[j][i + 1] = pre[j][i];
      }
      pre[i % 2][i + 1] += A[i];
    }
    int ans = 0;
    for (int i = 0; i < n; ++i) {
      if (pre[0][i] + pre[1][n] - pre[1][i + 1] ==
          pre[1][i] + pre[0][n] - pre[0][i + 1])
        ++ans;
    }
    cout << ans << '\n';
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  Solution().run();
}
