let () =
  Scanf.scanf "%d %d %d" @@ fun n m q ->
  let lr = Array.init m (fun _ -> Scanf.scanf " %d %d" (fun x y -> x-1, y-1)) in
  let pq = Array.init q (fun _ -> Scanf.scanf " %d %d" (fun x y -> x-1, y-1)) in

  let co = Array.init n (fun _ -> Array.make n 0) in
  lr |> Array.iter (fun (l, r) -> co.(l).(r) <- co.(l).(r) + 1);

  for w = 1 to n-1 do
    for j = 0 to n-1-w do
      co.(j).(j+w) <- co.(j).(j+w) + co.(j+1).(j+w) + co.(j).(j+w-1);
      if w > 1 then co.(j).(j+w) <- co.(j).(j+w) - co.(j+1).(j+w-1);
    done
  done;

  pq |> Array.iter (fun (p, q) -> Printf.printf "%d\n" co.(p).(q))