#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long a[n];
  long long max = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] > max) max = a[i];
  }
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    if (max > a[i]) ans++;
  }
  cout << ans << "\n";
  return 0;
}
