def main():

    N, M, Q, *X = list(map(int, open(0).read().split()))

    L = [0]*M

    R = [0]*M

    p = [0]*Q

    q = [0]*Q

    for i in range(M):

        L[i], R[i] = X[2*i], X[2*i + 1]

    for i in range(Q):

        p[i], q[i] = X[2*M + 2*i], X[2*M + 2*i + 1]

    # print(N, M, Q, L, R, p, q)

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

    for i in range(M):

        S[L[i]][R[i]] += 1

    # for s in S:

    #     print(s)

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

    for i in range(N+1):

        S2[i][0] = S[i][0]

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

            S2[i][j] = S2[i][j-1] + S[i][j]

    # for s in S2:

    #     print(s)

    for i in range(Q):

        pi, qi = p[i], q[i]

        ans = 0

        for j in range(pi, qi + 1):

            ans += (S2[j][qi] - S2[j][pi-1])

        print(ans)



if __name__ == '__main__':

    main()

def main():

    N, M, Q, *X = list(map(int, open(0).read().split()))

    L = [0]*M

    R = [0]*M

    p = [0]*Q

    q = [0]*Q

    for i in range(M):

        L[i], R[i] = X[2*i], X[2*i + 1]

    for i in range(Q):

        p[i], q[i] = X[2*M + 2*i], X[2*M + 2*i + 1]

    # print(N, M, Q, L, R, p, q)

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

    for i in range(M):

        S[L[i]][R[i]] += 1

    # for s in S:

    #     print(s)

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

    for i in range(N+1):

        S2[i][0] = S[i][0]

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

            S2[i][j] = S2[i][j-1] + S[i][j]

    # for s in S2:

    #     print(s)

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

    for i in range(N+1):

        S3[0][i] = S2[0][i]

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

            S3[j][i] = S3[j-1][i] + S2[j][i]

    for i in range(Q):

        pi, qi = p[i], q[i]

        ans = S3[qi][qi] - S3[qi][pi-1]

        ans -= S3[pi-1][qi] - S3[pi-1][pi-1]

        print(ans)





if __name__ == '__main__':

    main()

def main():
    N, M, Q, *X = list(map(int, open(0).read().split()))
    L = [0] * M
    R = [0] * M
    p = [0] * Q
    q = [0] * Q
    for i in range(M):
        L[i], R[i] = X[2 * i], X[2 * i + 1]
    for i in range(Q):
        p[i], q[i] = X[2 * M + 2 * i], X[2 * M + 2 * i + 1]
    # print(N, M, Q, L, R, p, q)
    S = [[0] * (N + 1) for i in range(N + 1)]
    for i in range(M):
        S[L[i]][R[i]] += 1
    # for s in S:
    #     print(s)
    S2 = [[0] * (N + 1) for i in range(N + 1)]
    for i in range(N + 1):
        S2[i][0] = S[i][0]
        for j in range(1, N + 1):
            S2[i][j] = S2[i][j - 1] + S[i][j]
    # for s in S2:
    #     print(s)
    for i in range(Q):
        pi, qi = p[i], q[i]
        ans = 0
        for j in range(pi, qi + 1):
            ans += S2[j][qi] - S2[j][pi - 1]
        print(ans)


if __name__ == "__main__":
    main()

def main():
    N, M, Q, *X = list(map(int, open(0).read().split()))
    L = [0] * M
    R = [0] * M
    p = [0] * Q
    q = [0] * Q
    for i in range(M):
        L[i], R[i] = X[2 * i], X[2 * i + 1]
    for i in range(Q):
        p[i], q[i] = X[2 * M + 2 * i], X[2 * M + 2 * i + 1]
    # print(N, M, Q, L, R, p, q)
    S = [[0] * (N + 1) for i in range(N + 1)]
    for i in range(M):
        S[L[i]][R[i]] += 1
    # for s in S:
    #     print(s)
    S2 = [[0] * (N + 1) for i in range(N + 1)]
    for i in range(N + 1):
        S2[i][0] = S[i][0]
        for j in range(1, N + 1):
            S2[i][j] = S2[i][j - 1] + S[i][j]
    # for s in S2:
    #     print(s)
    S3 = [[0] * (N + 1) for i in range(N + 1)]
    for i in range(N + 1):
        S3[0][i] = S2[0][i]
        for j in range(1, N + 1):
            S3[j][i] = S3[j - 1][i] + S2[j][i]
    for i in range(Q):
        pi, qi = p[i], q[i]
        ans = S3[qi][qi] - S3[qi][pi - 1]
        ans -= S3[pi - 1][qi] - S3[pi - 1][pi - 1]
        print(ans)


if __name__ == "__main__":
    main()

+    S3 = [[0] * (N + 1) for i in range(N + 1)] +    for i in range(N + 1): +        S3[0][i] = S2[0][i] +        for j in range(1, N + 1): +            S3[j][i] = S3[j - 1][i] + S2[j][i] -        ans = 0 -        for j in range(pi, qi + 1): -            ans += S2[j][qi] - S2[j][pi - 1] +        ans = S3[qi][qi] - S3[qi][pi - 1] +        ans -= S3[pi - 1][qi] - S3[pi - 1][pi - 1]