import Data.List

toInt :: String -> Int
toInt = read :: String -> Int

main = do
  [n, m, x] <- map toInt . words <$> getLine
  a <- map toInt . words <$> getLine
  print $ min (length $ filter (< x) a) (length $ filter (>x) a)
