use std::io::Read; fn main() { let mut s = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let v: Vec = s.split_whitespace().flat_map(str::parse).collect(); let mut a = 0; for b in (0..=400).rev() { let c = v[2..].iter().filter(|&&p| p >= b).count(); if c > v[1] { break; } a = c; } println!("{a}"); }