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