#include <bits/stdc++.h>
int main(void) {
  int N;
  std::cin >> N;
  std::vector<int> a(N);
  for (int i = 0; i < N; ++i) {
    std::cin >> a[i];
  }
  std::sort(a.begin(), a.end());
  std::cout << a.end() - a.begin() << std::endl;
  return 0;
}
