import Data.List

main = do
  (n:m:x:_) <- getLine >>= return . map read . words :: IO [Int]
  as <- getLine >>= return . map read . words :: IO [Int]

  print $ (\(a,b) -> minimum $ map length [a,b]) $ span (<x) as
