#include using namespace std; const int MAX_SCORE = 400; int main() { int n, k; cin >> n >> k; vector p(n); for (int& p_ : p) { cin >> p_; } int ans = 0; for (int score = 0; score <= MAX_SCORE; score++) { int count = 0; for (int& p_ : p) if (p_ >= score) count++; if (count <= k) ans = max(ans, count); } cout << ans << '\n'; return 0; }