#include <bits/stdc++.h>
using namespace std;
int main() {
  set<int> m;
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    if (v[i] != 0) m.insert(v[i]);
  }
  cout << m.size() << "\n";
}
