#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long seed;
  asm("rdtsc" : "=A"(seed));
  srand(seed);
  long long n;
  cin >> n;
  set<long long> s;
  s.insert(0);
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    s.insert(x);
  }
  cout << s.size() - 1 << '\n';
}
