#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n, a[1001], mx, count;
  cin >> n;
  mx = 0;
  count = 0;
  if (n > 0) {
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      mx = max(mx, a[i]);
    }
    for (int i = 0; i < n; i++) {
      if (a[i] < mx) {
        count++;
      }
    }
  }
  cout << count << endl;
  return 0;
}
