module Main where

import Control.Applicative
import Control.Monad
import Data.List (break)

main :: IO ()
main = do
    [n, m, x] <- fmap read . words <$> getLine
    as <- fmap read . words <$> getLine :: IO [Int]
    let (ls, rs) = break (> x) as
    print $ min (length ls) (length rs)