#include <bits/stdc++.h>
using namespace std;
long long int table[200001] = {0};
int main() {
  long long int myint;
  int num = 0;
  long long int count = 0;
  int tempnum = num;
  cin >> num;
  for (int p = 0; p < num; p++) {
    cin >> myint;
    int tempsize = tempnum - num;
    if (p == 0) {
      table[p] = myint;
    } else {
      table[p] = myint;
      if (myint == 0) count++;
      for (int i = 0; i < p; i++) {
        table[i] += myint;
        if (table[i] == 0) count++;
      }
    }
  }
  cout << count;
}
