#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, zero = 0;
  cin >> n;
  std::map<int, int> mp;
  for (int i = 0; i < n; i++) {
    int temp;
    cin >> temp;
    if (temp != 0) {
      mp[temp]++;
    }
  }
  int sum = 0, count = 0;
  cout << mp.size() << endl;
  return 0;
}
