#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int vect[n];
  for (int i = 0; i < n; i++) cin >> vect[i];
  sort(vect, vect + n);
  int ctr = vect[0] == 0 ? 0 : 1;
  for (int i = 1; i < n; i++) {
    if (vect[i] != 0 && vect[i] != vect[i - 1]) {
      ctr++;
    }
  }
  cout << ctr;
  return 0;
}
