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.io.PrintWriter;
import java.io.PrintStream;
import java.io.BufferedInputStream;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Comparator;
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) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		BufferedInputStream in = new BufferedInputStream(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}

	static class TaskD {
		public void solve(int testNumber, BufferedInputStream _in, PrintWriter out) {

			InputReader in = new InputReader(_in);
			long startTime = System.currentTimeMillis();
			int nt = 1;
			Task t = new Task(1);
			t.readInput(in);
			t.call();
			t.writeOutput(out);
			in.close();
			System.err.println("Time: " + (System.currentTimeMillis() - startTime) + " miliseconds");
		}

	}

	static class Task implements Callable<Task> {
		ArrayList<MyPoint> lm = new ArrayList<>();
		int m;
		ArrayList<MyPoint> lk = new ArrayList<>();
		int k;
		int re = 0;
		int testNumber;

		public void readInput(InputReader in) {
	/* read input here */
			k = in.nextInt();
			m = in.nextInt();

			for (int i = 0; i < k; ++i) {
				MyPoint mp = new MyPoint(in.nextInt(), in.nextInt(), 1, i);
				mp.next = new MyPoint[m];
				lk.add(mp);
			}
			for (int i = 0; i < m; ++i) {
				MyPoint mp = new MyPoint(in.nextInt(), in.nextInt(), 2, i);
				mp.next = new MyPoint[m];
				lm.add(mp);
			}

		}

		boolean ok(Point x, Point y, Point o) {
			long xx1 = x.x - o.x;
			long yy1 = x.y - o.y;

			long xx2 = y.x - o.x;
			long yy2 = y.y - o.y;

			return (xx1 * xx2 + yy1 * yy2) > 0;
		}

		void buildNext(ArrayList<Point> lp, MyPoint o) {

			for (int i = 1; i < lp.size(); ++i) {
				MyPoint p = (MyPoint) lp.get(i);
				int x = i - 1;
				while (x > 0) {
					MyPoint px = (MyPoint) lp.get(x);
					if (Point.collinear(p, px, o) && ok(p, px, o)) {
						if (px.type == 2) {
							p.next[o.id] = px;
							break;
						} else {
							--x;
						}
					} else {
						break;
					}
				}
			}
		}

		boolean canKill(Set<MyPoint> ss, int bd, int avail) {
			if (ss.size() == 0) return true;

			int nAvail = Integer.bitCount(avail) - 1;
			//if(nAvail <= 0 ) return false;

			for (int i = 0; i < k; ++i)
				if ((avail & (1 << i)) != 0) {
					MyPoint pk = lk.get(i);
					out:
					for (MyPoint mp : ss) {
						Set<MyPoint> newS = new HashSet<>(ss);
						newS.remove(mp);
						MyPoint next = pk.next[mp.id];
						while (next != null) {
							newS.add(next);
							if (newS.size() > nAvail)
								continue out;

							next = next.next[mp.id];
						}

						if (canKill(newS, i + 1, avail - (1 << i))) return true;
					}

				}
			return false;
		}

		public Task call() {
	/* process main algorithm here */

			ArrayList<Point> lp = new ArrayList<>();
			for (Point mp : lk) {

				lp.add(mp);
			}

			for (Point mp : lm) {

				lp.add(mp);
			}

			for (Point o : lm) {
				Point.sortByAngle(lp, o);
				buildNext(lp, (MyPoint) o);
			}


			for (MyPoint o : lm) {
				Set<MyPoint> s = new HashSet<>();
				s.add(o);
				if (canKill(s, 0, (1 << k) - 1)) {
					re++;
				} else {
					//System.err.println(o);
				}
			}

			return this;
		}

		public void writeOutput(PrintWriter out) {
			out.println(re);
		}

		Task(int testNumber) {
			this.testNumber = testNumber;
		}

	}

	static class MyPoint extends Point {
		int type = -1;
		int id = -1;
		MyPoint[] next;

		public MyPoint(MyPoint o) {
			super(o);
			this.type = type;
		}

		public MyPoint(long x, long y) {
			super(x, y);
		}

		public MyPoint(long x, long y, int type, int id) {
			super(x, y);

			this.type = type;
			this.id = id;
		}

	}

	static class Point implements Comparable<Point> {
		public long x;
		public long y;

		public Point(Point o) {
			this.x = o.x;
			this.y = o.y;

		}

		public Point(long x, long y) {
			super();

			this.x = x;
			this.y = y;
		}


		public int compareTo(Point o2) {
			int t = Long.compare(y, o2.y);
			if (t != 0) return t;
			return Long.compare(x, o2.x);
		}

		public static long _opPow(long x1, long y1, long x2, long y2) {
			return x1 * y2 - x2 * y1;
			//return LongMath.checkedSubtract(LongMath.checkedMultiply(x1, y2), LongMath.checkedMultiply(y1, x2));
		}

		public static long ccw(long lhsx, long lhsy, long rhsx, long rhsy) {
			return _opPow(lhsx, lhsy, rhsx, rhsy);
		}

		public static long ccw(Point lhs, Point rhs, Point origin) {
			//return ccw(new Point((lhs.x - origin.x), (lhs.y - origin.y)), new Point((rhs.x - origin.x), (rhs.y - origin.y)));
			return ccw(lhs.x - origin.x, lhs.y - origin.y, rhs.x - origin.x, rhs.y - origin.y);
		}

		public static boolean collinear(Point a, Point b, Point c) {
			return Point.ccw(c, b, a) == 0;
		}

		public static void sortByAngle(ArrayList<Point> points, Point origin) {
			ArrayList<Point> l0 = new ArrayList<>();
			ArrayList<Point> l1 = new ArrayList<>();
			ArrayList<Point> l2 = new ArrayList<>();
			for (Point p : points) {
				if (origin.compareTo(p) == 0) {
					l0.add(p);
				} else if (p.compareTo(origin) > 0) {
					l1.add(p);
				} else {
					l2.add(p);
				}
			}

			final Comparator<Point> cmp = (Point lhs, Point rhs) -> {
				long temp = Point.ccw(lhs, rhs, origin);
				if (temp == 0) {
					long x1 = lhs.x - origin.x;
					long y1 = lhs.y - origin.y;
					long x2 = rhs.x - origin.x;
					long y2 = rhs.y - origin.y;

					return Long.compare(x1 * x1 + y1 * y1, x2 * x2 + y2 * y2);

				} else return Long.compare(temp, 0l);

			};


			Collections.sort(l1, cmp);
			Collections.sort(l2, cmp);
			points.clear();
			points.addAll(l0);
			points.addAll(l1);
			points.addAll(l2);
		}


		public String toString() {
			return x + " " + y;
		}


		public int hashCode() {
			return Long.hashCode(x) ^ Long.hashCode(y);
		}

		public boolean equals(Object obj) {
			if (obj instanceof Point) {
				return compareTo((Point) obj) == 0;
			}
			return false;
		}

	}

	static class InputReader {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public static boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public void close() {

		}

	}
}

