#include <bits/stdc++.h>
using namespace std;
int read() {
  int s = 0, t = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') t = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s * t;
}
struct poi {
  int x, y;
  poi() {}
  poi(int _x, int _y) { x = _x, y = _y; }
};
poi operator+(poi a, poi b) { return poi(a.x + b.x, a.y + b.y); }
poi operator-(poi a, poi b) { return poi(a.x - b.x, a.y - b.y); }
long long cross(poi a, poi b) { return 1ll * a.x * b.y - 1ll * a.y * b.x; }
long long dot(poi a, poi b) { return 1ll * a.x * b.x + 1ll * a.y * b.y; }
long long dis(poi a, poi b) { return dot(b - a, b - a); }
poi st[10], p[1010];
int n, K;
vector<int> gg[1010][8];
void prework() {
  for (int i = 1; i <= n; i++)
    for (int k = 1; k <= K; k++)
      for (int j = 1; j <= n; j++)
        if (i != j && !cross(p[i] - st[k], p[j] - st[k]) &&
            dis(st[k], p[i]) >= dis(st[k], p[j]) + dis(p[i], p[j]))
          gg[i][k].push_back(j);
}
int id[8], ans;
bool vis[1010], inq[1010];
queue<int> q;
int wei[1010], top;
void work() {
  for (int x = 1; x <= n; x++) {
    for (int i = 1; i <= K; i++) id[i] = i;
    do {
      while (!q.empty()) q.pop();
      int cnt = 1, qwq = 1;
      wei[top = 1] = x;
      inq[x] = 1;
      q.push(x);
      while (!q.empty() && qwq <= K) {
        int cur = q.front();
        q.pop();
        for (int i = 0; i < gg[cur][id[cnt]].size(); i++)
          if (!inq[gg[cur][id[cnt]][i]] && qwq <= K) {
            int v = gg[cur][id[cnt]][i];
            q.push(v), qwq++, wei[++top] = v, inq[v] = 1;
          }
        cnt++;
      }
      for (int i = 1; i <= top; i++) inq[wei[i]] = 0;
      if (q.empty()) {
        vis[x] = 1;
        break;
      }
    } while (next_permutation(id + 1, id + K + 1));
    if (vis[x] == 1) ans++;
  }
}
int main() {
  K = read(), n = read();
  int x, y;
  for (int i = 1; i <= K; i++) x = read(), y = read(), st[i] = poi(x, y);
  for (int i = 1; i <= n; i++) x = read(), y = read(), p[i] = poi(x, y);
  prework();
  work();
  printf("%d\n", ans);
  return 0;
}
