#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
struct each {
  int id;
  long long x, y;
  each(int xx = 0, int yy = 0, int d = 0) { x = xx, y = yy, id = d; }
  long long operator*(each k) { return x * k.y - y * k.x; }
  each operator-(each k) { return each(x - k.x, y - k.y, id); }
  long long len() { return x * x + y * y; }
} a[10], c[N];
vector<int> b[10][N];
int n, k, ans, res, top, q[N], t[N], vi[N];
bool com(int x, int y) { return c[x].len() > c[y].len(); }
bool check(int x) {
  if (vi[x]) return true;
  if (res > k) return false;
  int k = q[res++], tmp = top;
  int si = b[k][x].size();
  vi[t[++top] = x] = 1;
  if (!si) return true;
  for (int i = 0; i < si; i++) {
    if (!check(b[k][x][i])) {
      while (top != tmp) vi[t[top--]] = 0;
      return false;
    }
  }
  return true;
}
bool work(int x) {
  for (int i = 1; i <= k; i++) q[i] = i;
  do {
    res = 1;
    if (check(x)) return true;
  } while (next_permutation(q + 1, q + k + 1));
  return false;
}
int main() {
  scanf("%d%d", &k, &n);
  for (int i = 1; i <= k; i++) scanf("%lld%lld", &a[i].x, &a[i].y);
  for (int i = 1; i <= n; i++) scanf("%lld%lld", &c[i].x, &c[i].y), c[i].id = i;
  for (int i = 1; i <= k; i++)
    for (int j = 1; j <= n; j++) {
      for (int k = 1; k <= n; k++) {
        if (!(c[k] - a[i]).len()) continue;
        if ((c[j] - a[i]) * (c[k] - a[i]) != 0) continue;
        if ((c[j] - a[i]).x * (c[k] - a[i]).x < 0) continue;
        if ((c[j] - a[i]).y * (c[k] - a[i]).y < 0) continue;
        if ((c[j] - a[i]).len() <= (c[k] - a[i]).len()) continue;
        b[i][j].push_back(k);
      }
      sort(b[i][j].begin(), b[i][j].end(), com);
    }
  for (int i = 1; i <= n; i++)
    if (work(i)) {
      while (top) vi[t[top--]] = 0;
      ++ans;
    }
  printf("%d\n", ans);
  return 0;
}
