#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, count = 0;
  long long A[200000];
  cin >> N;
  for (int i = 0; i < (N); i++) {
    int a;
    cin >> a;
    for (int j = 0; j < (i); j++) {
      if (A[j] == 0) count++;
      A[j] += a;
    }
    A[i] = a;
  }
  for (int i = 0; i < (N); i++)
    if (A[i] == 0) count++;
  cout << count << endl;
  return 0;
}
