eval"N,K,*A="+$<.read.split*?, p (1..400).map{|i|A.count{_1>=i}}.find{_1<=K}