#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  map<int, int> m;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] != 0) {
      m[arr[i]]++;
    }
  }
  cout << m.size() << endl;
  return 0;
}
