#include using namespace std; using ll = long long; using Graph = vector>; int main() { int N,K; cin >> N >> K; map dic; for(int i = 0; i < N; i++) { int a; cin >> a; dic[a]++; } vector a; for (const auto& [key, value] : dic) { a.push_back(value); } sort(a.begin(),a.end()); reverse(a.begin(),a.end()); int ans = 0; int y = 0; for(int i = 0; i < a.size();i++){ ans += a[i]; y++; if(ans >= K) { break; } } cout << y << endl; }