#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<int> a(n);
  vector<int> b(n + 1);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
    b.at(i + 1) = b.at(i) + a.at(i);
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (b.at(i) == 0) {
      cnt++;
    }
  }
  cout << cnt << endl;
}
