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