#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int *a = new int[n];
  map<int, int> mappp;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mappp[a[i]]++;
  }
  int count = 0;
  map<int, int>::iterator it;
  for (it = mappp.begin(); it != mappp.end(); it++) {
    if (it->first != 0) {
      count++;
    }
  }
  cout << count;
  return 0;
}
