#include <bits/stdc++.h>
using namespace std;
int main() {
  int sum = 0, s = 0, n, num = 0, x, i, j, *a;
  cin >> n;
  a = new int[n];
  for (i = 0; i < n; i++) {
    cin >> x;
    sum += x;
    a[i] = x;
  }
  s = sum;
  for (j = 0; j < n; j++) {
    for (i = 0; i < n - j; i++) {
      if (sum == 0) {
        num++;
        sum -= a[i];
        i++;
      }
      sum -= a[i];
    }
    s -= a[n - 1 - j];
    sum = s;
  }
  cout << num;
  return 0;
}
