tollGates :: Int -> Int -> [Int] -> Int
tollGates n x as = min cost0 costN
    where
        gates = [if x `elem` as then 1 else 0 | x <- [0..n]]
        cost0 = sum . take x $ gates
        costN = sum . drop (x + 1) $ gates

main :: IO ()
main = problemBDo

problemBDo = do
    [n,_,x] <- map read . words <$> getLine
    as <- map read . words <$> getLine
    putStrLn . show $ tollGates n x as