#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  vector<int> b(n);
  int res = 0;
  for (int i = (0); i <= (n - 1); ++i) cin >> b[i];
  sort(b.begin(), b.end());
  b.resize(unique(b.begin(), b.end()) - b.begin());
  for (int i = (0); i <= (b.size() - 1); ++i)
    if (b[i] != 0) res++;
  cout << res;
  return 0;
}
