#include <bits/stdc++.h>
using namespace std;
const int N = 1000;
map<int, int> mp;
int v[N];
int n, ans = 0;
void solve() {
  for (int i = 0; i < n; ++i) {
    int a;
    scanf("%d", &a);
    v[mp[a]]++;
    mp[a]++;
  }
  for (int i = 0; i < N; ++i) {
    ans += max(0, v[i] - 1);
  }
}
int main(int argc, char *argv[]) {
  scanf("%d", &n);
  solve();
  printf("%d", ans);
  return 0;
}
