#include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;

int main(){
  int n, m, x, y, xx, yy, ans;
  std::cin >> n >> m;
  vector<pii> t(n + 1);
  t[n].first = t[n].second = 1e9 + 7;
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &t[i].first, &t[i].second);
  }
  sort(t.begin(), t.end());
  for (int i = 0; i < m; i++) {
    ans = 0;
    scanf("%d %d %d %d", &x, &y, &xx, &yy);
    for (int j = 0; j < n; j++) {
      if(x <= t[j].first and t[j].first <= xx){
        if(y <= t[j].second and t[j].second <= yy)ans++;
      }else if(x < t[j].first){
        break;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}