#include <bits/stdc++.h>
const int maxn = 20500;
const long long mm = 998244353;
const long long inf = 1e18;
using namespace std;
int n, k, gg, ans[maxn], vis[maxn], p[maxn];
struct node {
  long long x, y;
  friend node operator-(node a, node b) { return (node){a.x - b.x, a.y - b.y}; }
} a[maxn], b[maxn];
long long sqr(long long x) { return x * x; }
long long dis(node a, node b) { return sqr(a.x - b.x) + sqr(a.y - b.y); }
long long cross(node a, node b) { return a.x * b.y - a.y * b.x; }
vector<int> g[maxn][10];
bool dfs(vector<int> vec, int now, int len) {
  if (gg) return 1;
  if (vec.empty()) return gg = 1;
  for (int i = 0; i < (int)vec.size(); i++) {
    vector<int> nvec;
    for (int j = 0; j < (int)vec.size(); j++)
      if (i != j) nvec.push_back(vec[j]);
    for (auto x : g[vec[i]][p[now]]) nvec.push_back(x);
    sort(nvec.begin(), nvec.end());
    nvec.resize(unique(nvec.begin(), nvec.end()) - nvec.begin());
    if ((int)nvec.size() >= len) continue;
    dfs(nvec, now + 1, len - 1);
  }
  return 0;
}
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", &b[i].x, &b[i].y);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= k; j++) {
      long long d = dis(a[j], b[i]);
      for (int p = 1; p <= n; p++)
        if (p != i) {
          if (g[i][j].size() > k) continue;
          if (cross(b[i] - a[j], b[p] - a[j]) == 0 && d > dis(b[p], a[j]) &&
              d > dis(b[p], b[i])) {
            g[i][j].push_back(p);
          }
        }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= k; j++) p[j] = j;
    do {
      vector<int> vec;
      vec.push_back(i);
      gg = 0;
      dfs(vec, 1, k);
      if (gg == 1) {
        ans[i] = 1;
        break;
      }
    } while (next_permutation(p + 1, p + 1 + k));
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++)
    if (ans[i]) cnt++;
  cout << cnt << endl;
  return 0;
}
