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