Bearland is a dangerous place. Limak can’t travel on foot. Instead, he has k magic teleportation stones. Each stone can be used at most once. The i-th stone allows to teleport to a point (axi, ayi). Limak can use stones in any order.

There are n monsters in Bearland. The i-th of them stands at (mxi, myi).

The given k + n points are pairwise distinct.

After each teleportation, Limak can shoot an arrow in some direction. An arrow will hit the first monster in the chosen direction. Then, both an arrow and a monster disappear. It’s dangerous to stay in one place for long, so Limak can shoot only one arrow from one place.

A monster should be afraid if it’s possible that Limak will hit it. How many monsters should be afraid of Limak?

Input

The first line of the input contains two integers k and n (1 ≤ k ≤ 7, 1 ≤ n ≤ 1000) — the number of stones and the number of monsters.

The i-th of following k lines contains two integers axi and ayi ( - 109 ≤ axi, ayi ≤ 109) — coordinates to which Limak can teleport using the i-th stone.

The i-th of last n lines contains two integers mxi and myi ( - 109 ≤ mxi, myi ≤ 109) — coordinates of the i-th monster.

The given k + n points are pairwise distinct.

Output

Print the number of monsters which should be afraid of Limak.

Examples

Input

2 4
-2 -1
4 5
4 2
2 1
4 -1
1 -1


Output

3


Input

3 8
10 20
0 0
20 40
300 600
30 60
170 340
50 100
28 56
90 180
-4 -8
-1 -2


Output

5

Note

In the first sample, there are two stones and four monsters. Stones allow to teleport to points ( - 2, - 1) and (4, 5), marked blue in the drawing below. Monsters are at (4, 2), (2, 1), (4, - 1) and (1, - 1), marked red. A monster at (4, - 1) shouldn't be afraid because it's impossible that Limak will hit it with an arrow. Other three monsters can be hit and thus the answer is 3.

<image>

In the second sample, five monsters should be afraid. Safe monsters are those at (300, 600), (170, 340) and (90, 180).
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Deque;
import java.util.ArrayList;
import java.util.Map;
import java.io.OutputStreamWriter;
import java.io.OutputStream;
import java.util.Collection;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.List;
import java.io.Closeable;
import java.io.Writer;
import java.util.Comparator;
import java.util.ArrayDeque;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "", 1 << 29);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastInput in = new FastInput(inputStream);
            FastOutput out = new FastOutput(outputStream);
            DLimakAndShootingPoints solver = new DLimakAndShootingPoints();
            solver.solve(1, in, out);
            out.close();
        }
    }

    static class DLimakAndShootingPoints {
        Point[] hero;
        Point[] monster;
        Deque<Point> heroDq = new ArrayDeque<>();
        List<Point> trace = new ArrayList<>();

        public void solve(int testNumber, FastInput in, FastOutput out) {
            int k = in.readInt();
            int n = in.readInt();

            hero = new Point[k];
            for (int i = 0; i < k; i++) {
                hero[i] = new Point(in.readInt(), in.readInt());
                hero[i].correspond = new List[n];
            }
            monster = new Point[n];
            for (int i = 0; i < n; i++) {
                monster[i] = new Point(in.readInt(), in.readInt());
                monster[i].id = i;
            }
            for (int i = 0; i < n; i++) {
                Map<Long, List<Point>> map = new HashMap<>();
                for (int j = 0; j < n; j++) {
                    if (i == j) {
                        continue;
                    }
                    Long sign = getSign(monster[j].x - monster[i].x,
                            monster[j].y - monster[i].y);
                    map.computeIfAbsent(sign, x -> new ArrayList<>()).add(monster[j]);
                }
                for (List<Point> list : map.values()) {
                    list.sort(monster[i].distComparator);
                }
                monster[i].map = map;
                for (int j = 0; j < k; j++) {
                    long sign = getSign(hero[j].x - monster[i].x, hero[j].y - monster[i].y);
                    List<Point> list = monster[i].map.getOrDefault(sign, Collections.emptyList());
                    hero[j].correspond[i] = list;
                }
            }

            fact(new boolean[k], new Point[k], 0);
            int ans = 0;
            for (Point pt : monster) {
                if (pt.killable) {
                    ans++;
                }
            }

            out.println(ans);
        }

        private void fact(boolean[] used, Point[] seq, int i) {
            if (i == seq.length) {
                for (Point m : monster) {
                    if (m.killable) {
                        continue;
                    }
                    heroDq.clear();
                    for (Point pt : seq) {
                        heroDq.addLast(pt);
                    }
                    killMonster(m);
                    for (Point pt : trace) {
                        pt.killed = false;
                    }
                    trace.clear();
                }
                return;
            }
            for (int j = 0; j < used.length; j++) {
                if (used[j]) {
                    continue;
                }
                used[j] = true;
                seq[i] = hero[j];
                fact(used, seq, i + 1);
                used[j] = false;
            }
        }

        private boolean killMonster(Point t) {
            if (t.killed) {
                return true;
            }
            if (heroDq.isEmpty()) {
                return false;
            }
            Point h = heroDq.removeFirst();

            List<Point> list = h.correspond[t.id];

            for (Point pt : list) {
                if (t.distComparator.compare(pt, h) >= 0) {
                    break;
                }
                if (!killMonster(pt)) {
                    return false;
                }
            }

            trace.add(t);
            t.killable = t.killed = true;
            return true;
        }

        private long getSign(int x, int y) {
            int g = GCDs.gcd(Math.abs(x), Math.abs(y));
            return DigitUtils.asLong(x / g, y / g);
        }

    }

    static class FastInput {
        private final InputStream is;
        private byte[] buf = new byte[1 << 13];
        private int bufLen;
        private int bufOffset;
        private int next;

        public FastInput(InputStream is) {
            this.is = is;
        }

        private int read() {
            while (bufLen == bufOffset) {
                bufOffset = 0;
                try {
                    bufLen = is.read(buf);
                } catch (IOException e) {
                    bufLen = -1;
                }
                if (bufLen == -1) {
                    return -1;
                }
            }
            return buf[bufOffset++];
        }

        public void skipBlank() {
            while (next >= 0 && next <= 32) {
                next = read();
            }
        }

        public int readInt() {
            int sign = 1;

            skipBlank();
            if (next == '+' || next == '-') {
                sign = next == '+' ? 1 : -1;
                next = read();
            }

            int val = 0;
            if (sign == 1) {
                while (next >= '0' && next <= '9') {
                    val = val * 10 + next - '0';
                    next = read();
                }
            } else {
                while (next >= '0' && next <= '9') {
                    val = val * 10 - next + '0';
                    next = read();
                }
            }

            return val;
        }

    }

    static class GCDs {
        private GCDs() {
        }

        public static int gcd(int a, int b) {
            return a >= b ? gcd0(a, b) : gcd0(b, a);
        }

        private static int gcd0(int a, int b) {
            return b == 0 ? a : gcd0(b, a % b);
        }

    }

    static class DigitUtils {
        private static long LONG_TO_INT_MASK = (1L << 32) - 1;

        private DigitUtils() {
        }

        public static long asLong(int high, int low) {
            return (((long) high) << 32) | (((long) low) & LONG_TO_INT_MASK);
        }

    }

    static class FastOutput implements AutoCloseable, Closeable, Appendable {
        private StringBuilder cache = new StringBuilder(10 << 20);
        private final Writer os;

        public FastOutput append(CharSequence csq) {
            cache.append(csq);
            return this;
        }

        public FastOutput append(CharSequence csq, int start, int end) {
            cache.append(csq, start, end);
            return this;
        }

        public FastOutput(Writer os) {
            this.os = os;
        }

        public FastOutput(OutputStream os) {
            this(new OutputStreamWriter(os));
        }

        public FastOutput append(char c) {
            cache.append(c);
            return this;
        }

        public FastOutput append(int c) {
            cache.append(c);
            return this;
        }

        public FastOutput println(int c) {
            return append(c).println();
        }

        public FastOutput println() {
            cache.append(System.lineSeparator());
            return this;
        }

        public FastOutput flush() {
            try {
                os.append(cache);
                os.flush();
                cache.setLength(0);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
            return this;
        }

        public void close() {
            flush();
            try {
                os.close();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        public String toString() {
            return cache.toString();
        }

    }

    static class Point {
        int x;
        int y;
        Comparator<Point> distComparator = (a, b) -> {
            return Integer.compare(weight(a), weight(b));
        };
        boolean killable;
        boolean killed;
        Map<Long, List<Point>> map;
        List<Point>[] correspond;
        int id;

        public int weight(Point a) {
            return Math.max(Math.abs(a.x - x), Math.abs(a.y - y));
        }

        public Point(int x, int y) {
            this.x = x;
            this.y = y;
        }

        public String toString() {
            return String.format("(%d, %d)", x, y);
        }

    }
}

