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