#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cout << *it << " = " << a << endl;
  err(++it, args...);
}
const long long mod = 1e9 + 7;
const long long maxN = 1e9;
const long long INF = 1e18;
const long double EPS = 1e-9;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  vector<int> a;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    int x;
    cin >> x;
    a.push_back(x);
  }
  sort((a).begin(), (a).end());
  vector<int>::iterator x = unique((a).begin(), (a).end());
  a.resize(distance(a.begin(), x));
  int res = 0;
  for (int x : a)
    if (x != 0) res++;
  cout << res;
  return 0;
}
