#include<iostream>
#include<vector>
#include<algorithm>

#define F first
#define S second
const int LIM = 1e9+5;

using namespace std;
typedef pair<int,int> P;
int n,m;
vector<P> V;

void input(){
  cin >> n >> m;
  V.resize(n);
  for(int i = 0; i < n; i++) cin >> V[i].F >> V[i].S;
}

void solve(){
  sort(V.begin(),V.end());
  P p1,p2;
  for(int i = 0; i < m; i++){
    cin >> p1.F >> p1.S >> p2.F >> p2.S;

    int ans = 0;
    int l = p1.F,r = p2.F,d = p1.S,u = p2.S;
    
    vector<P>::iterator ite = lower_bound(V.begin(),V.end(),P(l,-LIM));
    
    while(ite < V.end()){
      if(ite->F > r) break;
      //  cout << ite->F << " " << ite->S << endl;
      if(d <= ite->S && ite->S <= u){
	ans++;
      }//else ite = lower_bound(V.begin(),V.end(),P(ite->F+1,-LIM));
      ite++;
    }
    cout << ans << endl;
  }
}

int main(){
  input();
  solve();
  return 0;
}