#include <bits/stdc++.h>
const int N = 1000;
int n, k;
struct point {
  int x, y;
  point operator-(const point &rhs) const {
    return (point){x - rhs.x, y - rhs.y};
  }
} a[7], b[N];
bool same_sgn(int x, int y) { return !x || !y || (x > 0) == (y > 0); }
bool collinear(point a, point b) {
  return (long long)a.x * b.y == (long long)a.y * b.x && same_sgn(a.x, b.x) &&
         same_sgn(a.y, b.y);
}
bool on_segment(point a, point b, point c) {
  return collinear(a - b, c - b) && collinear(a - c, b - c);
}
std::vector<int> need[N][7];
bool unable[N][7], shot[N];
int p[7], id, ans;
bool dfs(int target) {
  if (id == k) return 0;
  int i = p[id++];
  bool success = 1;
  if (unable[target][i]) return 0;
  for (int nxt : need[target][i])
    if (!shot[nxt] && !dfs(nxt)) return 0;
  return shot[target] = 1;
}
int main() {
  std::ios::sync_with_stdio(0), std::cin.tie(0);
  std::cin >> k >> n;
  for (int i = 0; i < k; ++i) std::cin >> a[i].x >> a[i].y;
  for (int i = 0; i < n; ++i) std::cin >> b[i].x >> b[i].y;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < k; ++j)
      for (int p = 0; p < n; ++p)
        if (p != i && on_segment(b[p], b[i], a[j])) {
          need[i][j].emplace_back(p);
          if (need[i][j].size() >= k) {
            unable[i][j] = 1;
            break;
          }
        }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < k; ++j) p[j] = j;
    do
      if (dfs((std::memset(shot, id = 0, sizeof shot), i))) {
        ++ans;
        break;
      }
    while (std::next_permutation(p, p + k));
  }
  std::cout << ans << '\n';
  return 0;
}
