program test 
implicit none

integer(8) :: i,j,k,l,m,n,r,q
integer(8) :: ll(200000),rr(200000),pp(100000),qq(100000),nn(501,501)=0,nn2(0:501,0:501)=0

read(*,*) n,m,q
do i= 1,m
read(*,*) ll(i),rr(i)
enddo

do i=1,q
read(*,*) pp(i),qq(i)
enddo

do i=1,m
do j=1,ll(i)

nn(j,rr(i)) = nn(j,rr(i)) + 1

enddo
enddo

do i=1,n
do j=1,n
nn2(i,j) = nn2(i,j-1) + nn(i,j)
enddo
enddo

!do i=1,n+1
!write(*,*) nn2(i,1:n+1)
!enddo

do i=1,q
write(*,*) nn2(pp(i),qq(i))
enddo

end program