#include using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i> N >> K; vector A(N); for(int &a : A) cin >> a; map cnt; for(int &a : A) cnt[a]++; vector v; for(auto &c : cnt) v.emplace_back(c.second); sort(v.begin(), v.end(), greater()); int ans = 1; for(int &vv: v){ K -= vv; if(K <= 0) break; ans++; } cout << ans << endl; return 0; }