#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma G++ optimize(2)
using namespace std;
char nc() { return getchar(); }
int read() {
  int x = 0, y = 1;
  char c = nc();
  while (!isdigit(c)) {
    if (c == '-') y = -1;
    c = nc();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = nc();
  }
  return x * y;
}
int k, n;
struct point {
  long long x, y;
  point operator-(const point &other) const {
    return (point){x - other.x, y - other.y};
  }
  long long operator*(const point &other) const {
    return x * other.x + y * other.y;
  }
  long long operator^(const point &other) const {
    return x * other.y - y * other.x;
  }
} a[10], b[1005];
bool isbtw(point p1, point p2, point p3) {
  point v1 = p3 - p1, v2 = p3 - p2;
  return !(v1 ^ v2) && (v1 * v2) < 0;
}
vector<int> pre[10][1005];
int vst[10], p[10], ANS = 0;
bool flag;
int vis[1005], tot, ha[10];
bool check(int x) {
  tot++;
  if (tot > k) return false;
  int tp = tot;
  for (int i = 0, up = pre[p[tp]][x].size(); i < up; i++) {
    int t = pre[p[tp]][x][i];
    if (!vis[t] && !check(t)) return false;
  }
  ha[tp] = x;
  vis[x] = 1;
  return true;
}
void dfs(int now, int id) {
  if (flag) return;
  if (now == k + 1) {
    for (int i = 1; i <= tot; i++) vis[ha[i]] = 0;
    tot = 0;
    if (check(id)) flag = true;
    return;
  }
  for (int i = 1; i <= k; i++)
    if (!vst[i]) {
      vst[i] = 1;
      p[now] = i;
      dfs(now + 1, id);
      vst[i] = 0;
    }
}
int main() {
  k = read();
  n = read();
  for (int i = 1; i <= k; i++) a[i] = (point){read(), read()};
  for (int i = 1; i <= n; i++) b[i] = (point){read(), read()};
  for (int i = 1; i <= k; i++)
    for (int j = 1; j <= n; j++)
      for (int t = 1; t <= n; t++)
        if (j != t && isbtw(a[i], b[j], b[t])) pre[i][j].push_back(t);
  for (int i = 1; i <= n; i++) {
    flag = false;
    dfs(1, i);
    if (flag) ANS++;
  }
  printf("%d", ANS);
  return 0;
}
