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