#include <bits/stdc++.h>
using namespace std;
long long n;
set<long long> sett;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 1; i <= n; ++i) {
    long long num;
    cin >> num;
    if (num) sett.insert(num);
  }
  cout << sett.size();
  return 0;
}
