#include <bits/stdc++.h>
const int MAX_N = (int)2e5 + 123;
const double eps = 1e-6;
const int inf = (int)1e9 + 123;
using namespace std;
struct Point {
  int x, y;
} a[10], b[1005];
struct Line {
  long long a, b, c;
  Line() {}
  Line(Point first, Point second) {
    a = first.y - second.y;
    b = second.x - first.x;
    c = 0 - a * first.x - b * first.y;
  }
  long long apply(Point A) { return a * A.x + b * A.y + c; }
};
long long dist(Point a, Point b) {
  return (a.x - b.x) * 1ll * (a.x - b.x) + (a.y - b.y) * 1ll * (a.y - b.y);
}
int k, n;
vector<int> g[10][1005];
int p[10];
bool u[1005];
vector<int> st;
bool can(int v) {
  if (u[v]) return 1;
  if (st.empty()) return 0;
  int now = st.back();
  st.pop_back();
  for (auto i : g[now][v])
    if (!can(i)) return 0;
  u[v] = 1;
  return 1;
}
bool answer(int id) {
  for (int i = 0; i < k; i++) p[i] = i;
  do {
    for (int i = 0; i < n; i++) u[i] = 0;
    st.clear();
    for (int i = 0; i < k; i++) st.push_back(p[i]);
    if (can(id)) return 1;
  } while (next_permutation(p, p + k));
  return 0;
}
bool check(Point a, Point b, Point c) {
  Line now = Line(a, b);
  assert(!now.apply(a) && !now.apply(b));
  if (now.apply(c)) return 0;
  if (dist(a, c) >= dist(a, b)) return 0;
  if (dist(b, c) >= dist(a, b)) return 0;
  return 1;
}
int main() {
  cin >> k >> n;
  for (int i = 0; i < k; i++) cin >> a[i].x >> a[i].y;
  for (int i = 0; i < n; i++) cin >> b[i].x >> b[i].y;
  for (int i = 0; i < k; i++)
    for (int j = 0; j < n; j++)
      for (int k = 0; k < n; k++)
        if (check(a[i], b[j], b[k])) g[i][j].push_back(k);
  int ans = 0;
  for (int i = 0; i < n; i++) ans += answer(i);
  cout << ans;
  return 0;
}
