#include using namespace std; using ll=long long; using ld=long double; ld pie=3.141592653589793; ll inf=2000000000000000000; ll mod=998244353; int main(){ ll n,k; cin >> n >> k; vectora(n); vectormemo(n+1,0); for (ll i = 0; i < n; i++) { cin >> a[i]; memo[a[i]]+=1; } vectorx; for (ll i = 0; i <= n; i++) { if (memo[i]>0) { x.push_back(memo[i]); } } sort(x.begin(),x.end()); reverse(x.begin(),x.end()); ll now=0; for (ll i = 0; i < x.size(); i++) { now+=x[i]; if (now>=k) { cout << i+1 << endl; return 0; } } }