#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, ans = 0, w[200000] = {0};
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    w[i] += a;
    if (w[i] == 0) {
      ans++;
    }
  }
  sort(w, w + n);
  for (int i = 0; i < n; i++) {
    if (w[i] != 0) {
      if (w[i + 1] == w[i]) {
        ans++;
        i++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
