#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  int x, n;
  cin >> n;
  map<int, int> count;
  for (int i = 0; i < n; i++) cin >> x, count[x]++;
  int m = count.size();
  if (count.find(0) != count.end()) m--;
  cout << m;
}
