#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 4000000000000000001 int main(){ int n,k; cin>>n>>k; map mp; rep(i,n){ int a; cin>>a; mp[a]++; } vector c(n+5); for(auto a:mp){ c[a.second]++; } int ans = 0; for(int i=n;i>=0;i--){ while(c[i]!=0&&k>0){ k -= i; c[i]--; ans++; } } cout<