#include "bits/stdc++.h" using namespace std; template istream& operator >> (istream& in, vector& v) { for (auto &it:v) in >> it; return in; } template ostream& operator << (ostream& os, const vector& v) { for (auto it:v) os << it << " "; return os; } template istream& operator >> (istream& in, pair& p) { in >> p.first >> p.second; return in; } template ostream& operator << (ostream& os, const pair& p) { os << p.first << " " << p.second; return os; } // auto operator<<(ostream&o,auto&&v)->enable_if_t,decltype(o<<*end(v))>{int f=0,u=&o!=&cerr;o<<"["+u;for(auto&&x:v)(f++?o<<", "+u:o)<decltype(o<(t)){int f=0,u=&o!=&cerr;o<<"<"+u;apply([&](auto&...x){(((f++?o<<", "+u:o)<"+u;} template void minn(T1& a, T2 b) { a = min(a,b); } template void maxx(T1& a, T2 b) { a = max(a,b); } #define int long long #define pb push_back #define all(v) v.begin(),v.end() #define allr(v) v.rbegin(),v.rend() #define sz(v) (int)v.size() #define deb(x) cerr<<#x<<"="<>n>>k; vector a(n); cin>>a; map m; for(int i:a) m[i]++; multiset s; for(auto &it:m) s.insert(it.second); int ans=0; while(k>0){ int x=*s.rbegin(); s.erase(s.find(x)); k-=x,ans++; } cout<sync_with_stdio(0); int tc=1; // cin>>tc; while(tc--){ solve(); } return 0; }