#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  vector<int> v;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    v.push_back(t);
  }
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  v.erase(remove(v.begin(), v.end(), 0), v.end());
  cout << v.size() << '\n';
}
