{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}
import qualified Data.ByteString.Char8 as BC
import           Data.Maybe            (fromJust)

main :: IO ()
main = do
  [n, m, x] <- getInts
  as <- getInts
  print $ solve n m x as

solve :: Int -> Int -> Int -> [Int] -> Int
solve n m x as = min (length xs) (length ys)
  where (xs, ys) = span (< x) as

readInts :: BC.ByteString -> [Int]
readInts = map (fst . fromJust . BC.readInt) . BC.words

getInts :: IO [Int]
getInts = readInts <$> BC.getLine
