#include <bits/stdc++.h>
using namespace std;
int main() {
  const int mx = 100 * 1000;
  int n;
  cin >> n;
  set<int> s;
  vector<int> a(n);
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] != 0) s.insert(a[i]);
  }
  cout << s.size();
}
