program main
   implicit none
   integer n,h,w
   integer i,counter
   integer,allocatable,dimension(:)::a,b
   read(*,*)n,h,w
   allocate(a(n),b(n))
   do i=1,n
      read(*,*)a(i),b(i)
   enddo
   counter=0
   do i=1,n
      if(a(i)>=h .and. b(i)>=w)counter=counter+1
   enddo
   write(*,*)counter
end program main
