#include <bits/stdc++.h>
using namespace std;
int n, a[100000], i, m;
int main() {
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  m = n;
  sort(a, a + n);
  if (a[0] == 0) --m;
  for (i = 1; i < n; i++)
    if (a[i] == a[i - 1] || a[i] == 0) --m;
  cout << m;
  return 0;
}
