#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  set<int> s(a, a + n);
  if (s.find(0) == s.end())
    cout << s.size();
  else
    cout << s.size() - 1;
  return 0;
}
