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.PrintStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;


public class F {

	private static Scanner in = new Scanner(System.in);
	private static PrintStream out = System.out;
	
	private static class Fraction implements Comparable<Fraction> {
		public int p;
		public int q;
		private static int gcd(int a, int b) {
			int t;
			while (b > 0) {
				t = b;
				b = a%b;
				a = t;
			}
			return a;
		}
		public Fraction(int p, int q) {
			int g = gcd(Math.abs(p), Math.abs(q));
			this.p = p/g;
			this.q = q/g;
		}
		public int compareTo(Fraction o) {
			if (p != o.p)
				return p < o.p ? -1 : 1;
			if (q != o.q)
				return q < o.q ? -1 : 1;
			return 0;
		}
	}
	
	private static class Point implements Comparable<Point> {
		public boolean used = false;
		public long idx;
		public int x;
		public int y;
		public Point(long idx, int x, int y) {
			this.idx = idx;
			this.x = x;
			this.y = y;
		}
		public Point (int x, int y) {
			idx = -1L;
			this.x = x;
			this.y = y;
		}
		public long r2() {
			return x*(long) x + y* (long)y;
		}
		public Fraction theta() {
			return new Fraction(y, x);
		}
		public Point subtract(Point o) {
			return new Point(x - o.x, y - o.y);
		}
		public int compareTo(Point o) {
			if (idx != o.idx)
				return idx < o.idx ? -1 : 1;
			if (x != o.x)
				return x < o.x ? -1 : 1;
			if (y != o.y)
				return y < o.y ? -1 : 1;
			return 0;
		}
	}
	
	private static int k;
	private static int n;
	private static Point[] ts;
	private static Point[] ms;
	private static TreeMap<Fraction, Point[]>[] pp;
	private static Fraction[][] thetas;
	
	private static boolean nextPermutation(int[] perm) {
		int n = perm.length;
		if (n <= 1)
			return false;
		// let idx be the first index from the end where idx is not larger than idx + 1
		int idx = n - 2;
		while (idx >= 0 && perm[idx] >= perm[idx + 1])
			--idx;
		if (idx == -1)
			return false;
		// swap idx with the smallest element larger than it coming after idx
		for (int i = n - 1; ; --i)
			if (perm[i] > perm[idx]) {
				int t = perm[i];
				perm[i] = perm[idx];
				perm[idx] = t;
				break;
			}
		// reverse entries idx + 1, ..., n - 1
		int a = idx + 1;
		int b = n;
		for (int i = 0; i < (b - a)/2; ++i) {
			int t = perm[a + i];
			perm[a + i] = perm[b - 1 - i];
			perm[b - 1 - i] = t;
		}
		return true;
	}
	
	private static int pIdx;
	private static Point[] used;
	private static int usedSz;
	private static int[] perm;
	private static boolean cando(int mIdx) {
		if (pIdx == k)
			return false;
		int tIdx = perm[pIdx];
		Point m = ms[mIdx];
		Fraction theta = thetas[tIdx][mIdx];
		Point[] inline = pp[tIdx].get(theta);
		for (Point currIdx : inline) {
			Point curr = ms[(int) (currIdx.y + 0.5)];
			if (curr == m) {
				if (!curr.used) {
					used[usedSz++] = m;
					m.used = true;
				}
				return true;
			} else if (!curr.used) {
				++pIdx;
				if (!cando((int) curr.idx))
					return false;
			}
		}
		throw new RuntimeException();
	}
	
	public static void main(String[] args) {
		// read input
		k = in.nextInt();
		n = in.nextInt();
		ts = new Point[k];
		ms = new Point[n];
		for (int i = 0; i < k; ++i)
			ts[i] = new Point(in.nextInt(), in.nextInt());
		for (int i = 0; i < n; ++i)
			ms[i] = new Point(i, in.nextInt(), in.nextInt());
		// preprocess for each teleport the angles to the monsters
		pp = new TreeMap[k];
		thetas = new Fraction[k][n];
		for (int i = 0; i < k; ++i) {
			TreeMap<Fraction, ArrayList<Point>> ppTmp = new TreeMap<Fraction, ArrayList<Point>>();
			for (int j = 0; j < n; ++j) {
				Point delta = ms[j].subtract(ts[i]);
				long r2 = delta.r2();
				Fraction theta = delta.theta();
				thetas[i][j] = theta;
				if (!ppTmp.containsKey(theta))
					ppTmp.put(theta, new ArrayList<Point>());
				ppTmp.get(theta).add(new Point(r2, -1, j));
			}
			pp[i] = new TreeMap<Fraction, Point[]>();
			for (Map.Entry<Fraction, ArrayList<Point>> curr : ppTmp.entrySet()) {
				Fraction k = curr.getKey();
				Point[] v = curr.getValue().toArray(new Point[]{});
				Arrays.sort(v);
				pp[i].put(k, v);
			}
		}
		// set up solving variables
		used = new Point[k];
		usedSz = 0;
		int kFactorial = 1;
		for (int i = 2; i <= k; ++i)
			kFactorial *= i;
		perm = new int[k];
		for (int i = 0; i < k; ++i)
			perm[i] = i;
		int[][] perms = new int[kFactorial][k];
		for (int i = 0; i < kFactorial; ++i) {
			for (int j = 0; j < k; ++j)
				perms[i][j] = perm[j];
			nextPermutation(perm);
		}
		// solve
		int ans = 0;
		for (int i = 0; i < n; ++i) {
			boolean done = false;
			for (int j = 0; !done && j < perms.length; ++j) {
				perm = perms[j];
				pIdx = 0;
				if (cando(i)) {
					++ans;
					done = true;
				}
				while (usedSz > 0)
					used[--usedSz].used = false;
			}
		}
		out.println(ans);
	}

}
