solve :: Int -> [Int] -> Int
solve x ax = min costLeft costRight
  where costLeft  = length $ filter (< x) ax
        costRight = length $ filter (x <) ax

main :: IO ()
main = do
  [_, _, x] <- map read . words <$> getLine
  ax <- map read . words <$> getLine
  print $ solve x ax