#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, c;
  scanf("%lld", &n);
  long long a[n];
  for (long long i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a, a + n);
  c = 0;
  for (long long i = 1; i <= n; i++) {
    if (a[i] != a[i + 1]) {
      c++;
    }
  }
  printf("%lld\n", c - 1);
}
