#include <bits/stdc++.h>
using namespace std;
int main() {
  int longs, sum = 0, zerosum = 0;
  cin >> longs;
  vector<int> numbers(longs);
  vector<int> sums(longs);
  for (int i = 0; i < longs; i++) {
    cin >> numbers.at(i);
  }
  for (int i = 0; i < longs; i++) {
    sum += numbers.at(i);
    sums.at(i) = sum;
  }
  for (int i = 0; i < longs; i++) {
    for (int j = 0; j < longs; j++) {
      if (i != j) {
        if (sums.at(i) == sums.at(j)) zerosum++;
      }
    }
  }
  cout << zerosum << endl;
}
