#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count = 0, val;
  cin >> n;
  int vet[n];
  for (int i = 0; i < n; ++i) {
    cin >> vet[i];
  }
  sort(vet, vet + n);
  if (vet[0]) count++;
  for (int i = 1; i < n; ++i) {
    if (vet[i] && vet[i] != vet[i - 1]) {
      count++;
    }
  }
  cout << count;
  return 0;
}
