import Control.Applicative
import Control.Monad

main = do
    [n, m, x] <- map read . words <$> getLine
    as <- map read . words <$> getLine
    putStrLn $ show $ ans n m x as

ans :: Int -> Int -> Int -> [Int] -> Int
ans n m x as = min left right
    where
        left = length $ takeWhile (< x) as
        right = length $ dropWhile (< x) as
