#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

int n, m, x1_, y1_, x2_, y2_;

vector<int> x, y;

int main()
{
	scanf("%d", &n);
	scanf("%d", &m);

	x = vector<int>(n);
	y = vector<int>(n);

	for (int i = 0; i < n; i++)
	{
		scanf("%d", &x[i]);
		scanf("%d", &y[i]);
	}

	for (int i = 0; i < n; i++)
	{
		for (int j = i + 1; j < n; j++)
		{
			if (x[i] > x[j])
			{
				swap(x[i], x[j]);
				swap(y[i], y[j]);
			}
		}
	}

	for (int i = 0; i < m; i++)
	{
		scanf("%d", &x1_);
		scanf("%d", &y1_);
		scanf("%d", &x2_);
		scanf("%d", &y2_);

		int s = distance(x.begin(), upper_bound(x.begin(), x.end(), x1_ - 1));
		int t = distance(x.begin(), lower_bound(x.begin(), x.end(), x2_ + 1));

		int ret = 0;

		for (int j = s; j < t; j++)
		{
			if (y1_ <= y[j] && y[j] <= y2_)
			{
				ret++;
			}
		}

		printf("%d\n", ret);
	}

	return 0;
}