main = do
    [n,h,w] <- ((fmap read . words) <$> getLine) :: IO [Int]
    res <- solve n 0 h w
    print res

solve :: Int -> Int -> Int -> Int -> IO Int
solve 0   ac _ _ = return ac
solve cnt ac h w = do
    [a,b] <- ((fmap read . words) <$> getLine) :: IO [Int]
    case a>=h && b>=w of
        True -> solve (cnt-1) (ac+1) h w
        otherwise -> solve (cnt-1) ac h w
