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?
n,h,w=map(int,input().split())
ans=0
for i in range(n):
  a,b=map(int,input().split())
  if a<=h and b<=w:
    ans+=1
print(ans)
import sys
readline = sys.stdin.readline

N,H,W = map(int,readline().split())
ans = 0
for i in range(N):
  a,b = map(int,readline().split())
  if a >= H and b >= W:
    ans += 1
print(ans)