#include <bits/stdc++.h>   using namespace std;   vector<int> v;   int qtd[100001];   int main() {     int n;     scanf( %d , &n);     for (int i = 0; i < n; i++) {       int a;       scanf( %d , &a);       v.push_back(a);     }     sort(v.begin(), v.end());     int cont = 0;     for (int i = 1, tmp = 0; i < n; i++) {       if (v[i] > v[i - 1]) {         cont += i - tmp;         tmp = i;       }       qtd[i] = cont;     }     int ans = 0;     int used = 0;     for (int i = 0; i < n; i++) {       if (qtd[i] > used) {         used++;         ans++;       }     }     printf( %d n , ans);     return 0;   }   