use std::{collections::BTreeMap, io::Read}; fn main() { let mut s = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let n: Vec = s.split_whitespace().flat_map(str::parse).collect(); let mut h = BTreeMap::new(); let (mut a, mut c) = (1, 0); for &i in n[2..].iter() { *h.entry(i).or_insert(0) += 1; } for (_, &d) in h.iter().rev() { c += d; if c >= n[1] { break; } a += 1; } println!("{a}") }