#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> res;
  int i = 0;
  for (i = 0; i < a.size(); i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  i = 0;
  while (a[i] == 0) i++;
  for (; i < a.size(); i++) {
    if (i != 0 && a[i] == a[i - 1]) {
      ;
    } else {
      res.push_back(a[i]);
    }
  }
  cout << res.size() << endl;
  return 0;
}
