#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> vec;
  int n, num;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> num;
    if (num != 0) {
      vec.push_back(num);
    }
  }
  sort(vec.begin(), vec.end());
  vec.erase(unique(vec.begin(), vec.end()), vec.end());
  cout << vec.size() << endl;
}
