#include <bits/stdc++.h>
using namespace std;
bool isprime(long long n) {
  if (n < 2) return false;
  if (n == 2) return true;
  if (n % 2 == 0) return false;
  for (int i = 3; i * i <= n; i = i + 2) {
    if (n % i == 0) return false;
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int temp = -1, cnt = 0;
  for (int i = 0; i < n; i++) {
    if (temp != a[i] && a[i] != 0) {
      cnt++;
      temp = a[i];
    }
  }
  cout << cnt;
  return 0;
}
