#include <bits/stdc++.h>
using namespace std;
int n;
set<int> mySet;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    mySet.insert(x);
  }
  mySet.erase(0);
  cout << mySet.size();
  return 0;
}
