#include <bits/stdc++.h>
using namespace std;
struct Poi {
  long long x, y;
} p[10], a[2010];
int n, m, g[2010][10][10], q[2010], ans, r[10];
inline long long Len(Poi a, Poi b) {
  return ((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
inline long long Mul(Poi x, Poi a, Poi b) {
  return ((a.x - x.x) * (b.y - x.y) - (a.y - x.y) * (b.x - x.x));
}
inline void Uni(int &n) {
  if (!n) return;
  int n_ = n;
  n = 1;
  sort(q + 1, q + 1 + n_);
  for (int i = 2; i <= n_; i++)
    if (q[i] != q[n]) q[++n] = q[i];
}
inline bool Dfs(int top, int t) {
  if (!top) return (1);
  if (t > m || top > (m - t + 1)) return (0);
  int q_[10];
  for (int j = 1; j <= top; j++) q_[j] = q[j];
  for (int i = 1; i <= top; i++) {
    int top_ = 0;
    for (int j = 1; j <= top; j++)
      if (i != j) q[++top_] = q_[j];
    for (int j = 1; j <= g[q_[i]][r[t]][0]; j++) q[++top_] = g[q_[i]][r[t]][j];
    Uni(top_);
    if (Dfs(top_, t + 1)) return (1);
  }
  return (0);
}
int main() {
  scanf("%d%d", &m, &n);
  for (int i = 1; i <= m; i++) scanf("%I64d%I64d", &p[i].x, &p[i].y);
  for (int i = 1; i <= n; i++) scanf("%I64d%I64d", &a[i].x, &a[i].y);
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++)
      for (int k = 1; k <= n; k++)
        if (j != k) {
          long long l = Len(p[i], a[j]);
          long long l1 = Len(p[i], a[k]), l2 = Len(a[j], a[k]);
          if (Mul(p[i], a[j], a[k]) == 0 && l1 < l && l2 < l)
            g[j][i][++g[j][i][0]] = k;
          if (g[j][i][0] == m) break;
        }
  }
  for (int i = 1; i <= n; i++) {
    bool pd = 0;
    for (int j = 1; j <= m; j++) r[j] = j;
    do {
      q[1] = i;
      if (Dfs(1, 1)) {
        ans++;
        break;
      }
    } while (next_permutation(r + 1, r + 1 + m));
  }
  printf("%d\n", ans);
}
