import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as BS
main=do
 [n,c,k]<-map read.words<$>getLine
 t<-replicateM n (read.BS.unpack<$>BS.getLine)
 print (f (sort t) c k 0)
  where f [] _ _ i = i
        f (a:t) c k i = f (g (a:t) c (k+a)) c k (i+1)
        g [] _ _ = []
        g t 0 _ = t
        g (b:t) c k = if b<=k then (g t (c-1) k) else (b:t)