#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> v;
  int n, a, m;
  cin >> n;
  m = n;
  while (n--) {
    cin >> a;
    v.push_back(a);
  }
  sort(v.begin(), v.end());
  auto it = std::unique(v.begin(), v.begin() + m);
  v.resize(std::distance(v.begin(), it));
  cout << v.size() - count(v.begin(), v.end(), 0);
  return 0;
}
