#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int part[n], zero = 0;
  set<int, greater<int>> s1;
  int tem;
  for (int i = 0; i < n; i++) {
    cin >> tem;
    s1.insert(tem);
    if (tem == 0) zero = 1;
  }
  if (zero == 1) {
    cout << s1.size() - 1 << endl;
  } else {
    cout << s1.size() << endl;
  }
  return 0;
}
