// #define _GLIBCXX_DEBUG #include using namespace std; // #include // using namespace atcoder; using ll = long long; #define rep(i,n) for (ll i = 0; i < (n); ++i) using vl = vector; using vvl = vector; using P = pair; #define pb push_back #define int long long #define double long double #define INF (ll) 3e18 // Ctrl + Shift + B コンパイル // Ctrl + C 中断 // ./m 実行 signed main(){ int n, k; cin >> n >> k; map mp; rep(i,n){ int a; cin >> a; mp[a]++; } vl v; for(auto [_, x] : mp) v.push_back(x); sort(v.rbegin(), v.rend()); rep(i, v.size()){ k -= v[i]; if (k <= 0) { cout << i+1 << endl; return 0; } } }