from collections import Counter

from itertools import product



n,m,q  = list(map(int,input().split()))

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

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



xlist = [[0 for j in range(n)] for i in range(n)]

sumlist = [[0 for j in range(n+1)] for i in range(n)]

sumsumlist = [[0 for j in range(n+1)] for i in range(n+1)]

for (l,r),i in list(Counter(rails).items()):

    xlist[l-1][r-1]=i





for (i,j) in product(list(range(n)),list(range(n))):

    sumlist[i][j+1]=sum(xlist[i][0:j+1])



for (i,j) in product(list(range(n)),list(range(n))):

    sumsumlist[i+1][j+1] = sum([x[j+1] for x in sumlist[0:i+1]])







for (p,q) in qs:

    ans = sumsumlist[q][q]- sumsumlist[q][p-1] -sumsumlist[p-1][q] + sumsumlist[p-1][p-1]

    print(ans)





from collections import Counter

from itertools import product

import numpy as np



n,m,q  = list(map(int,input().split()))

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

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



xlist = np.array([[0 for j in range(n)] for i in range(n)])

for (l,r),i in list(Counter(rails).items()):

    xlist[l-1,r-1]=i



sumsumlist = np.cumsum(np.cumsum(xlist,axis=1),axis=0)





for (p,q) in qs:

    if p>1:

        ans = sumsumlist[q-1][q-1] - sumsumlist[q-1][p-2] - sumsumlist[p-2][q-1] + sumsumlist[p-2][p-2]

    elif p==1:

        ans = sumsumlist[q-1][q-1]



    print(ans)

from collections import Counter
from itertools import product

n, m, q = list(map(int, input().split()))
rails = [tuple(map(int, input().split())) for i in range(m)]
qs = [tuple(map(int, input().split())) for i in range(q)]
xlist = [[0 for j in range(n)] for i in range(n)]
sumlist = [[0 for j in range(n + 1)] for i in range(n)]
sumsumlist = [[0 for j in range(n + 1)] for i in range(n + 1)]
for (l, r), i in list(Counter(rails).items()):
    xlist[l - 1][r - 1] = i
for (i, j) in product(list(range(n)), list(range(n))):
    sumlist[i][j + 1] = sum(xlist[i][0 : j + 1])
for (i, j) in product(list(range(n)), list(range(n))):
    sumsumlist[i + 1][j + 1] = sum([x[j + 1] for x in sumlist[0 : i + 1]])
for (p, q) in qs:
    ans = (
        sumsumlist[q][q]
        - sumsumlist[q][p - 1]
        - sumsumlist[p - 1][q]
        + sumsumlist[p - 1][p - 1]
    )
    print(ans)

from collections import Counter
from itertools import product
import numpy as np

n, m, q = list(map(int, input().split()))
rails = [tuple(map(int, input().split())) for i in range(m)]
qs = [tuple(map(int, input().split())) for i in range(q)]
xlist = np.array([[0 for j in range(n)] for i in range(n)])
for (l, r), i in list(Counter(rails).items()):
    xlist[l - 1, r - 1] = i
sumsumlist = np.cumsum(np.cumsum(xlist, axis=1), axis=0)
for (p, q) in qs:
    if p > 1:
        ans = (
            sumsumlist[q - 1][q - 1]
            - sumsumlist[q - 1][p - 2]
            - sumsumlist[p - 2][q - 1]
            + sumsumlist[p - 2][p - 2]
        )
    elif p == 1:
        ans = sumsumlist[q - 1][q - 1]
    print(ans)

+import numpy as np -xlist = [[0 for j in range(n)] for i in range(n)] -sumlist = [[0 for j in range(n + 1)] for i in range(n)] -sumsumlist = [[0 for j in range(n + 1)] for i in range(n + 1)] +xlist = np.array([[0 for j in range(n)] for i in range(n)]) -    xlist[l - 1][r - 1] = i -for (i, j) in product(list(range(n)), list(range(n))): -    sumlist[i][j + 1] = sum(xlist[i][0 : j + 1]) -for (i, j) in product(list(range(n)), list(range(n))): -    sumsumlist[i + 1][j + 1] = sum([x[j + 1] for x in sumlist[0 : i + 1]]) +    xlist[l - 1, r - 1] = i +sumsumlist = np.cumsum(np.cumsum(xlist, axis=1), axis=0) -    ans = ( -        sumsumlist[q][q] -        - sumsumlist[q][p - 1] -        - sumsumlist[p - 1][q] -        + sumsumlist[p - 1][p - 1] -    ) +    if p > 1: +        ans = ( +            sumsumlist[q - 1][q - 1] +            - sumsumlist[q - 1][p - 2] +            - sumsumlist[p - 2][q - 1] +            + sumsumlist[p - 2][p - 2] +        ) +    elif p == 1: +        ans = sumsumlist[q - 1][q - 1]