#include <bits/stdc++.h>
using namespace std;
int main() {
  set<int> s;
  int n;
  cin >> n;
  int e;
  for (int i = 0; i < n; i++) {
    cin >> e;
    if (e != 0) s.insert(e);
  }
  int m = s.size();
  cout << m << endl;
  return 0;
}
