import Control.Monad

data Plate = Plate {
  height :: Int,
  width :: Int
} deriving (Show)

searchUsablePlates :: Plate -> [Plate] -> [Plate]
searchUsablePlates targetPlate plates = filter (isUsable targetPlate) plates
  
isUsable :: Plate -> Plate -> Bool
isUsable targetPlate plate = do
  height targetPlate <= height plate && width targetPlate <= width plate

main = do
  [n,h,w] <- map read . words <$> getLine :: IO [Int]
  plates <- replicateM n $ do
    [a, b] <- fmap (map read .words) getLine
    return Plate {height=a, width=b}
  let targetPlate = Plate{height=h, width=w}
  putStrLn $ show $ length $ searchUsablePlates targetPlate plates
  
  