I=lambda:list(map(int,input().split()))

n,m,q=I()

k=n+2

l=[0]*k**2

for _ in range(m):

  s,g=I()

  l[s*k+g]+=1

for i in range(1,n+1):

  for j in range(1,n+1):

    l[i*k+j]+=l[i*k+j-1]

for i in range(1,n+1):

  for j in range(1,n+1):

    l[i*k+j]+=l[(i-1)*k+j]

for _ in range(q):

  s,g=I()

  print((l[g*k+g]-l[(s-1)*k+g]-l[g*k+s-1]+l[(s-1)*k+s-1]))
I=lambda:list(map(int,input().split()))

n,m,q=I()

l=[[0]*-~n for _ in range(n+1)]

for _ in range(m):

  s,g=I()

  l[s][g]+=1

for i in range(1,n+1):

  for j in range(1,n+1):

    l[i][j]+=l[i][j-1]

  for j in range(1,n+1):

    l[i][j]+=l[i-1][j]

for _ in range(q):

  s,g=I()

  print((l[g][g]-l[s-1][g]-l[g][s-1]+l[s-1][s-1]))
I = lambda: list(map(int, input().split()))
n, m, q = I()
k = n + 2
l = [0] * k**2
for _ in range(m):
    s, g = I()
    l[s * k + g] += 1
for i in range(1, n + 1):
    for j in range(1, n + 1):
        l[i * k + j] += l[i * k + j - 1]
for i in range(1, n + 1):
    for j in range(1, n + 1):
        l[i * k + j] += l[(i - 1) * k + j]
for _ in range(q):
    s, g = I()
    print(
        (l[g * k + g] - l[(s - 1) * k + g] - l[g * k + s - 1] + l[(s - 1) * k + s - 1])
    )

I = lambda: list(map(int, input().split()))
n, m, q = I()
l = [[0] * -~n for _ in range(n + 1)]
for _ in range(m):
    s, g = I()
    l[s][g] += 1
for i in range(1, n + 1):
    for j in range(1, n + 1):
        l[i][j] += l[i][j - 1]
    for j in range(1, n + 1):
        l[i][j] += l[i - 1][j]
for _ in range(q):
    s, g = I()
    print((l[g][g] - l[s - 1][g] - l[g][s - 1] + l[s - 1][s - 1]))

-k = n + 2 -l = [0] * k**2 +l = [[0] * -~n for _ in range(n + 1)] -    l[s * k + g] += 1 +    l[s][g] += 1 -        l[i * k + j] += l[i * k + j - 1] -for i in range(1, n + 1): +        l[i][j] += l[i][j - 1] -        l[i * k + j] += l[(i - 1) * k + j] +        l[i][j] += l[i - 1][j] -    print( -        (l[g * k + g] - l[(s - 1) * k + g] - l[g * k + s - 1] + l[(s - 1) * k + s - 1]) -    ) +    print((l[g][g] - l[s - 1][g] - l[g][s - 1] + l[s - 1][s - 1]))