#include #define rep(i, n) for (int i = 0; i < n; ++i) typedef long long ll; using namespace std; int main() { cin.tie(0)->sync_with_stdio(0); int N, K; cin >> N >> K; vector cnt(N); rep(i, N) { int a; cin >> a; cnt[a - 1]++; } sort(cnt.rbegin(), cnt.rend()); int ans = 0, i = 0; while (K > 0) { K -= cnt[i++]; ans++; } cout << ans << "\n"; return 0; }