#include <bits/stdc++.h>
using namespace std;
int main() {
  set<int> s;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int c;
    cin >> c;
    if (c == 0) continue;
    s.insert(c);
  }
  cout << s.size() << "\n";
}
