#include <bits/stdc++.h>
using std::vector;
vector<int> path[10][1005];
int id, k, p[10], vis[1005], now, n, ans;
struct point {
  int x, y;
  point operator-(point b) { return point{x - b.x, y - b.y}; }
  long long operator*(point b) { return 1ll * x * b.y - 1ll * y * b.x; }
} a[10], b[1005];
long long dot(point x, point y) { return 1ll * x.x * y.x + 1ll * x.y * y.y; }
bool chk(point i, point j, point k) {
  if ((j - i) * (k - i) == 0 && dot((i - k), (j - k)) < 0) return 1;
  return 0;
}
bool dfs(int x) {
  if (id == k) return false;
  int y = p[++id];
  for (int i = 0; i < path[y][x].size(); i++)
    if (vis[path[y][x][i]] != now)
      if (!dfs(path[y][x][i])) return false;
  vis[x] = now;
  return true;
}
int main() {
  scanf("%d%d", &k, &n);
  for (int i = 1; i <= k; i++) scanf("%d%d", &a[i].x, &a[i].y);
  for (int i = 1; i <= n; i++) scanf("%d%d", &b[i].x, &b[i].y);
  for (int i = 1; i <= k; i++)
    for (int j = 1; j <= n; j++)
      for (int h = 1; h <= n; h++)
        if (chk(a[i], b[j], b[h])) path[i][j].push_back(h);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= k; j++) p[j] = j;
    do {
      ++now, id = 0;
      if (dfs(i)) {
        ++ans;
        break;
      }
    } while (std::next_permutation(p + 1, p + k + 1));
  }
  printf("%d\n", ans);
}
