output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N H W
      A_1 B_1
      A_2 B_2
      :
      A_N B_N
attempt: # _*_ coding:utf-8 _*_
  #  CADDi2018 for Beginners B AtCoderAlloy
  #  https://atcoder.jp/contests/caddi2018b/tasks/caddi2018b_b
  
  
  def checkGetArroy(getArroyHeight, getArroyWidth, nowArroyHeight, nowArroyWidth):
      if (getArroyHeight <= nowArroyHeight) and (getArroyWidth <= nowArroyWidth):
          return True
      else:
          return False
  
  
  def countGetArroy(
      allArroyNumber, arroyHeight, arroyWidth, eachArroyHeightList, eachArroyWidthList
  ):
  
      counter = 0
      patternRange = range(0, allArroyNumber, 1)
      for i in patternRange:
          checkResult = checkGetArroy(
              arroyHeight, arroyWidth, eachArroyHeightList[i], eachArroyWidthList[i]
          )
          if checkResult == True:
              counter = counter + 1
  
      return counter
  
  
  if __name__ == "__main__":
      n, h, w = map(int, input().strip().split(" "))
      alloyRange = range(0, n, 1)
      heightList = []
      widthList = []
      for i in alloyRange:
          tmpHeight, tmpWidth = map(int, input().strip().split(" "))
          heightList.append(tmpHeight)
          widthList.append(tmpWidth)
      solution = countGetArroy(n, h, w, heightList, widthList)
      print(solution)
  
problem_description: Statement
  
  There are N rectangular plate materials made of special metal called AtCoder
  Alloy. The dimensions of the i-th material are A_i \times B_i (A_i vertically
  and B_i horizontally).
  
  Takahashi wants a rectangular plate made of AtCoder Alloy whose dimensions are
  exactly H \times W. He is trying to obtain such a plate by choosing one of the
  N materials and cutting it if necessary. When cutting a material, the cuts
  must be parallel to one of the sides of the material. Also, the materials have
  fixed directions and cannot be rotated. For example, a 5 \times 3 material
  cannot be used as a 3 \times 5 plate.
  
  Out of the N materials, how many can produce an H \times W plate if properly
  cut?
samples: [{"input": "3 5 2\n    10 3\n    5 2\n    2 5", "output": "2\n    \n\nTakahashi wants a 5 \\times 2 plate.\n\n  * The dimensions of the first material are 10 \\times 3. We can obtain a 5 \\times 2 plate by properly cutting it.\n  * The dimensions of the second material are 5 \\times 2. We can obtain a 5 \\times 2 plate without cutting it.\n  * The dimensions of the third material are 2 \\times 5. We cannot obtain a 5 \\times 2 plate, whatever cuts are made. Note that the material cannot be rotated and used as a 5 \\times 2 plate.\n\n* * *"}, {"input": "10 587586158 185430194\n    894597290 708587790\n    680395892 306946994\n    590262034 785368612\n    922328576 106880540\n    847058850 326169610\n    936315062 193149191\n    702035777 223363392\n    11672949 146832978\n    779291680 334178158\n    615808191 701464268", "output": "8"}]