#include <bits/stdc++.h>

using namespace std;

#ifdef DEBUG_MODE
	#define DBG(n) n;
#else
	#define DBG(n) ;
#endif
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define rep(i,s,g) for(ll (i) = (s);(i) < (g);++i)
#define rrep(i,s,g) for(ll (i) = (s);i >= (g);--(i))
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define MOD 1000000007

typedef long long ll;
typedef pair<ll,ll> P;

int main(){
	int n,m;cin >> n >> m;
	vector<pair<int,int>> v;
	REP(i,n){
		int a,b;
		scanf("%d %d",&a,&b);
		v.PB(MP(a,b));
	}
	
	sort(ALL(v));
	int a,b,c,d;
	int ans;
	
	REP(i,m){
		scanf("%d %d %d %d",&a,&b,&c,&d);
		int st = 0;
		ans = 0;
		for(int i = st;i < n;i++){
			if(v[i].FI > c)break;
			if(v[i].FI >= a && v[i].SE >= b && v[i].SE <= d)ans++;
		}
		
		printf("%d\n",ans);
	}
	
	return 0;
}
