import Control.Applicative
import Control.Monad
import Data.List

main :: IO()
main = do
    [n, _, x] <- map read . words <$> getLine
    gates <- map read . words <$> getLine
    print $ solve n x gates
    
solve :: Int -> Int -> [Int] -> Int
solve n x gates = (calcValueTo0 x gates) `min` (calcValueToN x n gates)

calcValueTo0 :: Int -> [Int] -> Int
calcValueTo0 x gates = length . filter (`elem` gates) $ take x [0..]

calcValueToN :: Int -> Int -> [Int] -> Int
calcValueToN x n gates = length . filter (`elem` gates) $ [x..n]