import Control.Applicative

solve :: Int -> Int -> Int -> [Int] -> Int
solve n m x list = min left right
    where left = length $ filter (<x) list
          right = length $ filter (>x) list

main = do
    [n,m,x] <- map read . words <$> getLine
    list <- map read . words <$> getLine
    print $ solve n m x list