#include <bits/stdc++.h>
int main() {
  long long int n, i, max = 0, cnt = 0;
  scanf("%lld", &n);
  int a[n];
  max = 0;
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (a[i] > max) {
      max = a[i];
    }
  }
  for (i = 0; i < n; i++) {
    if (max > a[i]) {
      cnt++;
    }
  }
  printf("%lld\n", cnt);
  return 0;
}
