#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  vector<int> a;
  int n, t;
  cin >> n;
  a.reserve(n);
  while (n--) {
    cin >> t;
    if (t != 0) {
      a.push_back(t);
    }
  }
  sort(a.begin(), a.end());
  cout << unique(a.begin(), a.end()) - a.begin();
  return 0;
}
