N,M,Q = map(int,input().split())

src = [tuple(map(lambda x:int(x)-1,input().split())) for i in range(M)]

src.sort(reverse=True)

qs = [tuple(map(lambda x:int(x)-1,input().split())) for i in range(Q)]



q_arr = [[] for i in range(N)]

for i,(l,r) in enumerate(qs):

    q_arr[l].append((r,i))



bit = [0] * (N+2)

def bit_add(a,w):

    x = a

    while x <= N:

        bit[x] += w

        x += (x & -x)



def bit_sum(a):

    x = a

    ret = 0

    while x > 0:

        ret += bit[x]

        x -= (x & -x)

    return ret



ans = [None] * Q



last_l = N-1

for l,r in src:

    while last_l > l:

        for qr,qi in q_arr[last_l]:

            ans[qi] = bit_sum(qr+1)

        last_l -= 1

    bit_add(r+1, 1)

while last_l >= 0:

    for qr,qi in q_arr[last_l]:

        ans[qi] = bit_sum(qr+1)

    last_l -= 1



print(*ans, sep='\n')

N,M,Q = map(int,input().split())

src = [tuple(map(int,input().split())) for i in range(M)]

qs = [tuple(map(int,input().split())) for i in range(Q)]



imos = [[0]*(N+1) for i in range(N+1)]

for l,r in src:

    imos[l][r] += 1

for i in range(N+1):

    for j in range(N):

        imos[i][j+1] += imos[i][j]

for i in range(N):

    for j in range(N+1):

        imos[i+1][j] += imos[i][j]



ans = []

for p,q in qs:

    ans.append(imos[q][q] - imos[q][p-1] - imos[p-1][q] + imos[p-1][p-1])

print(*ans, sep='\n')

N, M, Q = map(int, input().split())
src = [tuple(map(lambda x: int(x) - 1, input().split())) for i in range(M)]
src.sort(reverse=True)
qs = [tuple(map(lambda x: int(x) - 1, input().split())) for i in range(Q)]
q_arr = [[] for i in range(N)]
for i, (l, r) in enumerate(qs):
    q_arr[l].append((r, i))
bit = [0] * (N + 2)


def bit_add(a, w):
    x = a
    while x <= N:
        bit[x] += w
        x += x & -x


def bit_sum(a):
    x = a
    ret = 0
    while x > 0:
        ret += bit[x]
        x -= x & -x
    return ret


ans = [None] * Q
last_l = N - 1
for l, r in src:
    while last_l > l:
        for qr, qi in q_arr[last_l]:
            ans[qi] = bit_sum(qr + 1)
        last_l -= 1
    bit_add(r + 1, 1)
while last_l >= 0:
    for qr, qi in q_arr[last_l]:
        ans[qi] = bit_sum(qr + 1)
    last_l -= 1
print(*ans, sep="\n")

N, M, Q = map(int, input().split())
src = [tuple(map(int, input().split())) for i in range(M)]
qs = [tuple(map(int, input().split())) for i in range(Q)]
imos = [[0] * (N + 1) for i in range(N + 1)]
for l, r in src:
    imos[l][r] += 1
for i in range(N + 1):
    for j in range(N):
        imos[i][j + 1] += imos[i][j]
for i in range(N):
    for j in range(N + 1):
        imos[i + 1][j] += imos[i][j]
ans = []
for p, q in qs:
    ans.append(imos[q][q] - imos[q][p - 1] - imos[p - 1][q] + imos[p - 1][p - 1])
print(*ans, sep="\n")

-src = [tuple(map(lambda x: int(x) - 1, input().split())) for i in range(M)] -src.sort(reverse=True) -qs = [tuple(map(lambda x: int(x) - 1, input().split())) for i in range(Q)] -q_arr = [[] for i in range(N)] -for i, (l, r) in enumerate(qs): -    q_arr[l].append((r, i)) -bit = [0] * (N + 2) - - -def bit_add(a, w): -    x = a -    while x <= N: -        bit[x] += w -        x += x & -x - - -def bit_sum(a): -    x = a -    ret = 0 -    while x > 0: -        ret += bit[x] -        x -= x & -x -    return ret - - -ans = [None] * Q -last_l = N - 1 +src = [tuple(map(int, input().split())) for i in range(M)] +qs = [tuple(map(int, input().split())) for i in range(Q)] +imos = [[0] * (N + 1) for i in range(N + 1)] -    while last_l > l: -        for qr, qi in q_arr[last_l]: -            ans[qi] = bit_sum(qr + 1) -        last_l -= 1 -    bit_add(r + 1, 1) -while last_l >= 0: -    for qr, qi in q_arr[last_l]: -        ans[qi] = bit_sum(qr + 1) -    last_l -= 1 +    imos[l][r] += 1 +for i in range(N + 1): +    for j in range(N): +        imos[i][j + 1] += imos[i][j] +for i in range(N): +    for j in range(N + 1): +        imos[i + 1][j] += imos[i][j] +ans = [] +for p, q in qs: +    ans.append(imos[q][q] - imos[q][p - 1] - imos[p - 1][q] + imos[p - 1][p - 1])