import java.io.*;
import java.util.*;

public class stars_mb_slow {
    static class IntScanner implements Closeable {
        BufferedReader in;
        StringTokenizer st;

        public IntScanner(String fileName) throws IOException {
            in = new BufferedReader(new FileReader(fileName));
        }

        public int nextInt() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(in.readLine());
            }
            return Integer.parseInt(st.nextToken());
        }

        public void close() throws IOException {
            in.close();
        }
    }

    public static void main(String[] args) throws IOException {
        IntScanner in = new IntScanner("stars.in");
        PrintWriter out = new PrintWriter("stars.out");
        int n = in.nextInt();
        int m = in.nextInt();
        int[] x = new int[n];
        int[] y = new int[n];
        for (int i = 0; i < n; ++i) {
            x[i] = in.nextInt();
            y[i] = in.nextInt();
        }
        for (int i = 0; i < m; ++i) {
            int minX = in.nextInt();
            int maxX = in.nextInt();
            int minY = in.nextInt();
            int maxY = in.nextInt();
            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.println(count);
        }
        out.close();
        in.close();
    }
}