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

public class stars_mb_quad_slow {
    static class Quad {
        final int minX, minY, size;

        Quad upperLeft, lowerLeft, upperRight, lowerRight;

        int count = 0;

        Quad(int minX, int minY, int size) {
            this.minX = minX;
            this.minY = minY;
            this.size = size;

            if (minX > minX + size - 1 || minY > minY + size - 1) {
                throw new AssertionError();
            }

            if (Integer.bitCount(size) != 1) {
                throw new AssertionError();
            }
        }

        void add(int x, int y) {
            if (minX <= x && x < minX + size && minY <= y && y < minY + size) {
                ++count;
                if (size != 1) {
                    if (upperLeft == null) {
                        int hs = size >>> 1;
                        lowerLeft = new Quad(minX, minY, hs);
                        upperLeft = new Quad(minX, minY + hs, hs);
                        lowerRight = new Quad(minX + hs, minY, hs);
                        upperRight = new Quad(minX + hs, minY + hs, hs);
                    }
                    upperLeft.add(x, y);
                    upperRight.add(x, y);
                    lowerLeft.add(x, y);
                    lowerRight.add(x, y);
                }
            }
        }

        int query(int lx, int rx, int ly, int ry) {
            int result = 0;
            if (count == 0 || lx <= minX && minX + size - 1 <= rx && ly <= minY && minY + size - 1 <= ry) {
                result = count;
            } else if (upperLeft != null) {
                result = upperLeft.query(lx, rx, ly, ry) +
                        upperRight.query(lx, rx, ly, ry) +
                         lowerLeft.query(lx, rx, ly, ry) +
                        lowerRight.query(lx, rx, ly, ry);
            }
            return result;
        }
    }

    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");
        int n = in.nextInt();
        int m = in.nextInt();
        PrintWriter out = new PrintWriter("stars.out");
        Quad q = new Quad(-(1 << 30), -(1 << 30), (1 << 31));
        for (int i = 0; i < n; ++i) {
            q.add(in.nextInt(), in.nextInt());
        }
        for (int i = 0; i < m; ++i) {
            int lx = in.nextInt();
            int rx = in.nextInt();
            int ly = in.nextInt();
            int ry = in.nextInt();
            out.println(q.query(lx, rx, ly, ry));
        }
        out.close();
        in.close();
    }
}