#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  ll n, m = 0, ans = 0, A[81019];
  cin >> n;
  for (ll i = 0; i < n; i++) cin >> A[i];
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < i; j++) {
      for (int k = 0; k < i; k++) m += A[k];
      if (m == 0) {
        ans++;
        m - A[j];
      } else
        m - A[j];
    }
    m = 0;
  }
  cout << ans << endl;
  return 0;
}
