main :: IO ()
main = do
    [n,m,x] <- map read . words <$> getLine :: IO [Int]
    as <- map read . words <$> getLine :: IO [Int]
    putStrLn $ show $ if (length (filter (<x) as) <= length (filter (>x) as)) then length (filter (<x) as) else length (filter (>x) as)