#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int A[N];
  for (int i = 0; i < N; i++) cin >> A[i];
  int T1[N + 1];
  T1[0] = 0;
  int s = 0;
  for (int i = 0; i < N; i++) {
    s += A[i];
    T1[i + 1] = s;
  }
  int SUM = s;
  int T2[N + 1];
  T2[0] = SUM;
  for (int i = 0; i < N; i++) {
    s -= A[i];
    T2[i + 1] = s;
  }
  int c = 0;
  for (int i = 0; i < N + 1; i++) {
    for (int j = i + 1; j < N + 1; j++) {
      if (SUM - T1[i] - T2[j] == 0) c++;
    }
  }
  cout << c << endl;
  return 0;
}
