program two
  implicit none
  integer :: i
  integer :: n, h, w
  integer, allocatable :: a(:), b(:)
  integer :: count

  count=0

  read(*,*)n,h,w
  
  allocate(a(n))
  allocate(b(n))
  
  do i=1,n
     read(*,*)a(i),b(i)
  end do

  do i=1,n
     if (h<=a(i) .and. w<=b(i)) then
        count=count+1
     end if
  end do

  write(*,*)count

end program two