program caddi2018b
  implicit none
  integer n, h, w, i
  integer, dimension(:), allocatable :: a, b

  read *, n, h, w
  allocate(a(n), b(n))

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

  print '(i0)', count(a.ge.h.and.b.ge.w)
end program caddi2018b
