{-# OPTIONS_GHC -O #-}

import Data.List
import Control.Monad

main=do
    [n,m,x]<-map read.words<$>getLine::IO[Int]
    as<-map read.words<$>getLine::IO[Int]

    print $ liftM2 min (length.fst) (length.snd) $ partition (<x) as