import Control.Applicative ((<$>), (<*>))

main :: IO ()
main = solve <$> (map read <$> words <$> getLine) <*> (map read <$> words <$> getLine) >>= print

solve :: [Int] -> [Int] -> Int
solve [n, m, x] as
  | 2 * ln <= x = ln
  | otherwise = m - ln
  where
    ln = length $ filter (< x) as
