#include <fstream>

int x[100000];
int y[100000];
int n, m, minX, maxX, minY, maxY;

int main()
{
    std::ifstream in("stars.in");
    std::ofstream out("stars.out");
    in >> n >> m;
    for (int i = 0; i < n; ++i) {
        in >> x[i] >> y[i];
    }
    for (int i = 0; i < m; ++i) {
        in >> minX >> maxX >> minY >> maxY;
        int count = 0;
        for (int j = 0; j < n; ++j) {
            if (minX <= x[j] && x[j] <= maxX && minY <= y[j] && y[j] <= maxY) {
                ++count;
            }
        }
        out << count << '\n';
    }
    return 0;
}
