program CADDiB2018B
    implicit none
    integer(8)::N,H,W,A,B,i,ans=0
    read*,N,H,W
    do i=1,N
        read*,A,B
        if(A>=H.and.B>=W)ans=ans+1
    end do
    print'(i0)',ans
end program CADDiB2018B