#include <bits/stdc++.h>
using namespace std;
bool less_vectors(const vector<long long>& a, const vector<long long>& b) {
  return a.size() < b.size();
}
vector<pair<long long, long long> > v;
vector<long long> s(1e6, 0);
void build(long long id, long long lo, long long hi) {
  if (lo == hi) {
    s[id] = v[lo - 1].second;
    return;
  }
  long long mid = (lo + hi) >> 1;
  build(2 * id, lo, mid);
  build(2 * id + 1, mid + 1, hi);
  s[id] = min(s[2 * id], s[2 * id + 1]);
}
long long query(long long id, long long lo, long long hi, long long l,
                long long r) {
  if (lo > r || hi < l) return 2000000000;
  if (lo >= l && hi <= r) return s[id];
  long long mid = (lo + hi) >> 1;
  return min(query(2 * id, lo, mid, l, r),
             query(2 * id + 1, mid + 1, hi, l, r));
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  long long zer = 0;
  set<long long> s;
  for (long long i = 0; i < n; i++) {
    long long a;
    cin >> a;
    s.insert(a);
    if (a == 0) zer = 1;
  }
  cout << s.size() - zer;
  return 0;
}
