#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ar[200000], i;
  int c = 0, mx = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> ar[i];
    mx = max(ar[i], mx);
  }
  for (i = 0; i < n; i++) {
    if (ar[i] != mx) c++;
  }
  cout << c << endl;
}
