#include <bits/stdc++.h>
using namespace std;
set<long long int> s;
void sieve() {
  std::vector<bool> arr(1000001, true);
  for (long long int i = 3; i * i < 1000001; i += 2) {
    if (arr[i] == true) {
      for (long long int j = i * i; j <= 1000001; j += i) arr[j] = false;
    }
  }
  s.insert(2);
  for (long long int i = 3; i * i < 1000001; i += 2) {
    if (arr[i]) s.insert(i);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  long long int arr[n];
  set<long long int> s;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
    s.insert(arr[i]);
  }
  if (s.find(0) != s.end())
    cout << s.size() - 1 << endl;
  else
    cout << s.size() << endl;
  return 0;
}
