#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
double eps = 1e-7;
long long INF = static_cast<long long>(2e18);
int inf = static_cast<int>(1e9 + 7);
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> in(n);
  for (auto& it : in) cin >> it;
  sort((in).begin(), (in).end());
  set<int> s;
  for (auto& it : in)
    if (it != 0) s.insert(it);
  cout << s.size();
  return 0;
}
