#include <bits/stdc++.h>
using namespace std;
int n;
void solve() {
  long long ans = 0;
  int m = 0;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i], m = max(m, a[i]);
  for (int i = 0; i < n; i++)
    if (a[i] < m) ans++;
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int l = 1;
  while (l--) {
    solve();
  }
  return 0;
}
