#include using namespace std; int main() { int n, k; cin >> n >> k; vector cnt(100100); for (int i = 0; i < n; ++i) { int a; cin >> a; cnt[a]++; } sort(cnt.rbegin(), cnt.rend()); for (int i = 0; i < n; ++i) { k -= cnt[i]; if (k <= 0) { cout << i + 1 << endl; return 0; } } }