#include <bits/stdc++.h>
using namespace std;
int n;
int a[100005];
void Input() {
  cin >> n;
  for (int i = (1); i <= (n); ++i) cin >> a[i];
  sort(a + 1, a + 1 + n);
  int m = unique(a + 1, a + 1 + n) - a - 1;
  int res = 0;
  for (int i = (1); i <= (m); ++i)
    if (a[i] != 0) ++res;
  cout << res;
}
void Solve() {}
int main() {
  iostream::sync_with_stdio(false);
  cin.tie(0);
  Input();
  Solve();
  return 0;
}
