#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  set<int> s;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    s.insert(x);
  }
  set<int>::iterator it = s.begin();
  int c = 0;
  while (it != s.end()) {
    if (*it == 0) c++;
    it++;
  }
  cout << s.size() - c << endl;
}
