let () = Scanf.scanf "%d %d %d\n" @@ fun n m q ->
  let dp = Array.make_matrix (n + 1) (n + 1) 0 in
  for i = 0 to m - 1 do
    Scanf.scanf "%d %d\n" @@ fun l r ->
      dp.(l).(r) <- dp.(l).(r) + 1
  done;
  for i = 0 to n do
    for j = 0 to n - 1 do
      dp.(i).(j + 1) <- dp.(i).(j) + dp.(i).(j + 1)
    done
  done;
  for i = n downto 1 do
    for j = 0 to n do
      dp.(i - 1).(j) <- dp.(i).(j) + dp.(i - 1).(j)
    done
  done;
  for i = 0 to q - 1 do
    Scanf.scanf "%d %d\n" @@ fun p q ->
      Printf.printf "%d\n" dp.(p).(q)
  done
