main = do
    [n, m, x] <- map (read :: (String -> Int)) . words <$> getLine
    ryokinjo <- map read . words <$> getLine
    let answer = min (length $ filter (> x) ryokinjo) (length $ filter (< x) ryokinjo)
    print answer