#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long *a = new long long[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  set<long long> s;
  for (long long i = 0; i < n; i++) s.insert(a[i]);
  long long count = 0;
  for (auto a : s) {
    if (a != 0) count++;
  }
  cout << count << endl;
  return 0;
}
