use std::{collections::HashMap, 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 = HashMap::new(); let (mut a, mut c) = (1, 0); for &i in n[2..].iter() { *h.entry(i).or_insert(0) += 1; } let mut v: Vec<_> = h.values().collect(); v.sort(); for &d in v.iter().rev() { c += d; if c >= n[1] { break; } a += 1; } println!("{a}") }