#include <bits/stdc++.h>
using namespace std;
const int oo = 1e9;
const int LOGN = 18;
const int MAX_N = 200000;
int n, a;
vector<int> v;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a;
    if (a) v.push_back(a);
  }
  sort(v.begin(), v.end());
  v.resize(unique(v.begin(), v.end()) - v.begin());
  cout << v.size() << endl;
  return 0;
}
