#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  unordered_map<int, int> idx;
  int N, x;
  cin >> N;
  while (N--) {
    cin >> x;
    if (x) idx[x] = 1;
  }
  cout << idx.size() << endl;
  return 0;
}
