import sys



input = lambda :sys.stdin.readline().rstrip()



def main():

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

    Train= [[0 for _ in range(n)] for _ in range(n)]

    

    for i in range(m):

        l, r = list(map(int, input().split()))

        l, r = l - 1, r - 1

        Train[l][r] += 1

    

    P_Train = [[0 for _ in range(n + 1)] for _ in range(n)]

    for i in range(n):

        tmp = 0

        for j in range (n):

            tmp += Train[i][j]

            P_Train[i][j + 1] = tmp



    for i in range(Q):

        p, q = list(map(int, input().split()))

        p, q = p - 1, q - 1

        ans = solve(P_Train, n, p, q)

        print(ans)



def solve(P_Train, n, p, q):

    ans = 0

    for i in range(p, q + 1):

        ans += P_Train[i][q + 1] - P_Train[i][p]

    return ans





if __name__ == '__main__':

    main()
import sys



input = lambda :sys.stdin.readline().rstrip()



def main():

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

    Train= [[0 for _ in range(n)] for _ in range(n)]

    

    for i in range(m):

        l, r = list(map(int, input().split()))

        l, r = l - 1, r - 1

        Train[l][r] += 1

    

    P_Train = [[0 for _ in range(n + 1)] for _ in range(n + 1)]

    for i in range(n):

        for j in range(n):

            P_Train[i + 1][j + 1] = P_Train[i][j + 1] + P_Train[i + 1][j] + Train[i][j] - P_Train[i][j]

    

    #print(*P_Train, sep = '\n')



    for i in range(Q):

        p, q = list(map(int, input().split()))

        p, q = p - 1, q - 1

        ans = solve(P_Train, p, q)

        print(ans)



def solve(P_Train, p, q):

    ans = 0

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

    return ans





if __name__ == '__main__':

    main()
import sys

input = lambda: sys.stdin.readline().rstrip()


def main():
    n, m, Q = list(map(int, input().split()))
    Train = [[0 for _ in range(n)] for _ in range(n)]
    for i in range(m):
        l, r = list(map(int, input().split()))
        l, r = l - 1, r - 1
        Train[l][r] += 1
    P_Train = [[0 for _ in range(n + 1)] for _ in range(n)]
    for i in range(n):
        tmp = 0
        for j in range(n):
            tmp += Train[i][j]
            P_Train[i][j + 1] = tmp
    for i in range(Q):
        p, q = list(map(int, input().split()))
        p, q = p - 1, q - 1
        ans = solve(P_Train, n, p, q)
        print(ans)


def solve(P_Train, n, p, q):
    ans = 0
    for i in range(p, q + 1):
        ans += P_Train[i][q + 1] - P_Train[i][p]
    return ans


if __name__ == "__main__":
    main()

import sys

input = lambda: sys.stdin.readline().rstrip()


def main():
    n, m, Q = list(map(int, input().split()))
    Train = [[0 for _ in range(n)] for _ in range(n)]
    for i in range(m):
        l, r = list(map(int, input().split()))
        l, r = l - 1, r - 1
        Train[l][r] += 1
    P_Train = [[0 for _ in range(n + 1)] for _ in range(n + 1)]
    for i in range(n):
        for j in range(n):
            P_Train[i + 1][j + 1] = (
                P_Train[i][j + 1] + P_Train[i + 1][j] + Train[i][j] - P_Train[i][j]
            )
    # print(*P_Train, sep = '\n')
    for i in range(Q):
        p, q = list(map(int, input().split()))
        p, q = p - 1, q - 1
        ans = solve(P_Train, p, q)
        print(ans)


def solve(P_Train, p, q):
    ans = 0
    ans = P_Train[q + 1][q + 1] - P_Train[p][q + 1] - P_Train[q + 1][p] + P_Train[p][p]
    return ans


if __name__ == "__main__":
    main()

-    P_Train = [[0 for _ in range(n + 1)] for _ in range(n)] +    P_Train = [[0 for _ in range(n + 1)] for _ in range(n + 1)] -        tmp = 0 -            tmp += Train[i][j] -            P_Train[i][j + 1] = tmp +            P_Train[i + 1][j + 1] = ( +                P_Train[i][j + 1] + P_Train[i + 1][j] + Train[i][j] - P_Train[i][j] +            ) +    # print(*P_Train, sep = '\n') -        ans = solve(P_Train, n, p, q) +        ans = solve(P_Train, p, q) -def solve(P_Train, n, p, q): +def solve(P_Train, p, q): -    for i in range(p, q + 1): -        ans += P_Train[i][q + 1] - P_Train[i][p] +    ans = P_Train[q + 1][q + 1] - P_Train[p][q + 1] - P_Train[q + 1][p] + P_Train[p][p]