open Printf
open Scanf

let id x = x

let (n, m, q) = scanf "%d %d %d" (fun n m q -> n, m, q)

let table = Array.init (n + 1) (fun i -> [])

let _ = Array.init m (fun i ->
    let (l, r) = scanf " %d %d" (fun l r -> l, r) in
    table.(l) <- r :: table.(l))

let _ = Array.init q (fun i ->
    let (q1, q2) = scanf " %d %d" (fun q1 q2 -> q1, q2) in
    let c = ref 0 in
    for i = q1 to q2 do
        List.iter (fun v -> if v <= q2 then incr c) table.(i)
    done;
    printf "%d\n" !c)
    