scan :: Int -> Int -> [[Int]] -> Int
scan h w = iter 0 where
    iter c [] = c
    iter c ([a, b]:xs)
        | a >= h && b >= w = iter (c+1) xs
        | otherwise = iter c xs
    
readData :: Int -> IO [[Int]]
readData 0 = return []
readData n = do
    line1 <- getLine
    let xs = map (\x -> read x :: Int) (words line1)
    fmap (xs:) $ readData (n-1)
        
main :: IO() 
main = do
    line1 <- getLine
    let [stN, stH, stW] = words line1
        n = read stN :: Int
        h = read stH :: Int
        w = read stW :: Int
    l <- readData n
    let ans = scan h w l
    print ans
