#include <bits/stdc++.h>
using namespace std;
int n, a[100000], c;
int main() {
  cin >> n;
  bool kt = false;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 0) kt = true;
  }
  if (kt) c--;
  sort(a, a + n);
  c++;
  int last = 0;
  for (int i = 1; i < n; i++)
    if (a[i] != a[last]) {
      c++;
      last = i;
    }
  cout << c;
}
