main = do
    [n, m, x] <- map read . words <$> getLine :: IO [Int]
    a <- map read . words <$> getLine :: IO [Int]
    let left = length (takeWhile (< x) a)
    let right = m - left
    print $ min left right
