#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { int32_t n, k; cin >> n >> k; vector hist(401); for (auto i = 0; i < n; ++i) { int32_t p; cin >> p; ++hist[p]; } int32_t ans = 0; reverse(hist.begin(), hist.end()); for (auto c : hist) { if (ans + c > k) break; ans += c; } cout << ans << endl; return 0; }