#include <bits/stdc++.h>
using namespace std;
int read();
int K, n;
vector<int> v[102][2003];
int vis[2003], cnt, perm[102];
bool check(int u, int id) {
  if (++cnt > K) return 0;
  if (!v[perm[cnt]][u].size()) return vis[u] = id, 1;
  int t = perm[cnt];
  for (int i = 0, v; i < ::v[t][u].size(); ++i)
    if (vis[v = ::v[t][u][i]] != id)
      if (!check(v, id)) return 0;
  return vis[u] = id, 1;
}
bool work(int u) {
  for (int i = 1; i <= K; ++i) perm[i] = i;
  memset(vis, 0, sizeof vis);
  int id = 0;
  while (1) {
    if (cnt = 0, check(u, ++id)) return 1;
    if (!next_permutation(perm + 1, perm + 1 + K)) break;
  }
  return 0;
}
struct P {
  long long x, y;
  void init() { x = read(), y = read(); }
  P operator-(P a) { return (P){x - a.x, y - a.y}; }
  long long operator*(P a) { return x * a.y - y * a.x; }
  long long operator^(P a) { return x * a.x + y * a.y; }
} p[102], q[2003];
int main() {
  K = read(), n = read();
  for (int i = 1; i <= K; ++i) p[i].init();
  for (int i = 1; i <= n; ++i) q[i].init();
  for (int i = 1; i <= K; ++i)
    for (int j = 1; j <= n; ++j)
      for (int k = 1; k <= n; ++k)
        if (j != k && (p[i] - q[j]) * (q[j] - q[k]) == 0 &&
            ((p[i] - q[k]) ^ (q[j] - q[k])) < 0)
          v[i][j].push_back(k);
  int res = 0;
  for (int i = 1; i <= n; ++i) res += work(i);
  printf("%d\n", res);
  return 0;
}
const int _SIZE = 1 << 22;
char ibuf[_SIZE], *iS = ibuf, *iT = ibuf;
int read() {
  int x = 0, f = 1;
  char c = (iS == iT ? iT = ((iS = ibuf) + fread(ibuf, 1, _SIZE, stdin)),
            (iS == iT ? EOF : *iS++) : *iS++);
  while (!isdigit(c))
    f = (c == '-') ? -1 : f,
    c = (iS == iT ? iT = ((iS = ibuf) + fread(ibuf, 1, _SIZE, stdin)),
         (iS == iT ? EOF : *iS++) : *iS++);
  while (isdigit(c))
    x = x * 10 + c - '0',
    c = (iS == iT ? iT = ((iS = ibuf) + fread(ibuf, 1, _SIZE, stdin)),
         (iS == iT ? EOF : *iS++) : *iS++);
  return x * f;
}
