from copy import deepcopy



N, M, Q = [int(elem) for elem in input().split(' ')]

lines = [[int(elem) for elem in input().split(' ')] for _ in range(M)]

queries = [[int(elem) for elem in input().split(' ')] for _ in range(Q)]





def cuml_1d(N, lines, queries):

    coords = [[0] * N for _ in range(N)]

    for l, r in lines:

        coords[l - 1][r - 1] += 1



    cuml_coords = deepcopy(coords)

    for l in range(N):

        for r in range(1, N):

            cuml_coords[l][r] = cuml_coords[l][r - 1] + coords[l][r]



    for query in queries:

        p, q = query[0] - 1, query[1] - 1

        num_lines = 0

        for l in range(p, max(q + 1, N)):

            if p == 0:

                num_lines += cuml_coords[l][q]

            else:

                num_lines += cuml_coords[l][q] - cuml_coords[l][p - 1]

        print(num_lines)



#cuml_1d(N, lines, queries)





def cuml_2d(N, lines, queries):

    coords = [[0] * N for _ in range(N)]

    for l, r in lines:

        coords[l - 1][r - 1] += 1

    cuml_l = deepcopy(coords)

    for r in range(N):

        for l in range(1, N):

            cuml_l[l][r] = cuml_l[l - 1][r] + coords[l][r]

    cuml_2d = deepcopy(cuml_l)

    for l in range(N):

        for r in range(1, N):

            cuml_2d[l][r] = cuml_2d[l][r - 1] + cuml_l[l][r]

    

    for query in queries:

        p, q = query[0] - 1, query[1] - 1

        if p != 0:

            num_lines = cuml_2d[q][q] - cuml_2d[q][p-1] - cuml_2d[p-1][q] + cuml_2d[p-1][p-1]

        else:

            num_lines = cuml_2d[q][q]

        print(num_lines)



cuml_2d(N, lines, queries)

import sys 

fin = sys.stdin.readline



N, M, Q = [int(elem) for elem in fin().split()]

trains = [[int(elem) - 1 for elem in fin().split()] for _ in range(M)]

queries = [[int(elem) - 1 for elem in fin().split()] for _ in range(Q)]



map_2D = [[0] * N for _ in range(N)]

for l, r in trains:

    map_2D[l][r] += 1



cuml_1D = [[0] * N for _ in range(N)]

# vertical

for j in range(N):

    cuml_sum = 0

    for i in reversed(list(range(j + 1))):

        cuml_sum += map_2D[i][j]

        cuml_1D[i][j] = cuml_sum



cuml_2D = [[0] * N for _ in range(N)]

# horizontal

for i in range(N):

    cuml_sum = 0

    for j in range(N):

        cuml_sum += cuml_1D[i][j]

        cuml_2D[i][j] = cuml_sum



for p, q in queries:

    print((cuml_2D[p][q]))

from copy import deepcopy

N, M, Q = [int(elem) for elem in input().split(" ")]
lines = [[int(elem) for elem in input().split(" ")] for _ in range(M)]
queries = [[int(elem) for elem in input().split(" ")] for _ in range(Q)]


def cuml_1d(N, lines, queries):
    coords = [[0] * N for _ in range(N)]
    for l, r in lines:
        coords[l - 1][r - 1] += 1
    cuml_coords = deepcopy(coords)
    for l in range(N):
        for r in range(1, N):
            cuml_coords[l][r] = cuml_coords[l][r - 1] + coords[l][r]
    for query in queries:
        p, q = query[0] - 1, query[1] - 1
        num_lines = 0
        for l in range(p, max(q + 1, N)):
            if p == 0:
                num_lines += cuml_coords[l][q]
            else:
                num_lines += cuml_coords[l][q] - cuml_coords[l][p - 1]
        print(num_lines)


# cuml_1d(N, lines, queries)
def cuml_2d(N, lines, queries):
    coords = [[0] * N for _ in range(N)]
    for l, r in lines:
        coords[l - 1][r - 1] += 1
    cuml_l = deepcopy(coords)
    for r in range(N):
        for l in range(1, N):
            cuml_l[l][r] = cuml_l[l - 1][r] + coords[l][r]
    cuml_2d = deepcopy(cuml_l)
    for l in range(N):
        for r in range(1, N):
            cuml_2d[l][r] = cuml_2d[l][r - 1] + cuml_l[l][r]
    for query in queries:
        p, q = query[0] - 1, query[1] - 1
        if p != 0:
            num_lines = (
                cuml_2d[q][q]
                - cuml_2d[q][p - 1]
                - cuml_2d[p - 1][q]
                + cuml_2d[p - 1][p - 1]
            )
        else:
            num_lines = cuml_2d[q][q]
        print(num_lines)


cuml_2d(N, lines, queries)

import sys

fin = sys.stdin.readline
N, M, Q = [int(elem) for elem in fin().split()]
trains = [[int(elem) - 1 for elem in fin().split()] for _ in range(M)]
queries = [[int(elem) - 1 for elem in fin().split()] for _ in range(Q)]
map_2D = [[0] * N for _ in range(N)]
for l, r in trains:
    map_2D[l][r] += 1
cuml_1D = [[0] * N for _ in range(N)]
# vertical
for j in range(N):
    cuml_sum = 0
    for i in reversed(list(range(j + 1))):
        cuml_sum += map_2D[i][j]
        cuml_1D[i][j] = cuml_sum
cuml_2D = [[0] * N for _ in range(N)]
# horizontal
for i in range(N):
    cuml_sum = 0
    for j in range(N):
        cuml_sum += cuml_1D[i][j]
        cuml_2D[i][j] = cuml_sum
for p, q in queries:
    print((cuml_2D[p][q]))

-from copy import deepcopy +import sys -N, M, Q = [int(elem) for elem in input().split(" ")] -lines = [[int(elem) for elem in input().split(" ")] for _ in range(M)] -queries = [[int(elem) for elem in input().split(" ")] for _ in range(Q)] - - -def cuml_1d(N, lines, queries): -    coords = [[0] * N for _ in range(N)] -    for l, r in lines: -        coords[l - 1][r - 1] += 1 -    cuml_coords = deepcopy(coords) -    for l in range(N): -        for r in range(1, N): -            cuml_coords[l][r] = cuml_coords[l][r - 1] + coords[l][r] -    for query in queries: -        p, q = query[0] - 1, query[1] - 1 -        num_lines = 0 -        for l in range(p, max(q + 1, N)): -            if p == 0: -                num_lines += cuml_coords[l][q] -            else: -                num_lines += cuml_coords[l][q] - cuml_coords[l][p - 1] -        print(num_lines) - - -# cuml_1d(N, lines, queries) -def cuml_2d(N, lines, queries): -    coords = [[0] * N for _ in range(N)] -    for l, r in lines: -        coords[l - 1][r - 1] += 1 -    cuml_l = deepcopy(coords) -    for r in range(N): -        for l in range(1, N): -            cuml_l[l][r] = cuml_l[l - 1][r] + coords[l][r] -    cuml_2d = deepcopy(cuml_l) -    for l in range(N): -        for r in range(1, N): -            cuml_2d[l][r] = cuml_2d[l][r - 1] + cuml_l[l][r] -    for query in queries: -        p, q = query[0] - 1, query[1] - 1 -        if p != 0: -            num_lines = ( -                cuml_2d[q][q] -                - cuml_2d[q][p - 1] -                - cuml_2d[p - 1][q] -                + cuml_2d[p - 1][p - 1] -            ) -        else: -            num_lines = cuml_2d[q][q] -        print(num_lines) - - -cuml_2d(N, lines, queries) +fin = sys.stdin.readline +N, M, Q = [int(elem) for elem in fin().split()] +trains = [[int(elem) - 1 for elem in fin().split()] for _ in range(M)] +queries = [[int(elem) - 1 for elem in fin().split()] for _ in range(Q)] +map_2D = [[0] * N for _ in range(N)] +for l, r in trains: +    map_2D[l][r] += 1 +cuml_1D = [[0] * N for _ in range(N)] +# vertical +for j in range(N): +    cuml_sum = 0 +    for i in reversed(list(range(j + 1))): +        cuml_sum += map_2D[i][j] +        cuml_1D[i][j] = cuml_sum +cuml_2D = [[0] * N for _ in range(N)] +# horizontal +for i in range(N): +    cuml_sum = 0 +    for j in range(N): +        cuml_sum += cuml_1D[i][j] +        cuml_2D[i][j] = cuml_sum +for p, q in queries: +    print((cuml_2D[p][q]))