#include <bits/stdc++.h>
using namespace std;
const int M = 7 + 2, N = 1005;
struct point {
  long long x, y;
  point(long long xx = 0, long long yy = 0) { x = xx, y = yy; }
} a[M], b[N];
inline point operator+(point a, point b) { return point(a.x + b.x, a.y + b.y); }
inline point operator-(point a, point b) { return point(a.x - b.x, a.y - b.y); }
inline long long operator*(point a, point b) { return a.x * b.y - a.y * b.x; }
inline long long len(point A) { return A.x * A.x + A.y * A.y; }
int m, n;
vector<int> G[M][N];
inline bool check(point A, point B, point C) {
  if ((B - A) * (C - A) != 0) return 1;
  if (A.x < C.x && C.x < B.x) return 0;
  if (B.x < C.x && C.x < A.x) return 0;
  if (A.y < C.y && C.y < B.y) return 0;
  if (B.y < C.y && C.y < A.y) return 0;
  return 1;
}
int p[M], ok[N];
bool vis[N];
int q[M], ql, qr;
inline int solve(int w) {
  int i, x, y, z, now = 1;
  memset(vis, 0, n + 1);
  q[ql = qr = 1] = w;
  vis[w] = 1;
  while (ql <= qr && now <= m) {
    x = q[ql], ++ql;
    y = p[now], ++now;
    if (G[y][x].size() >= m) return 0;
    for (i = 0; i < G[y][x].size(); ++i) {
      z = G[y][x][i];
      if (!vis[z]) q[++qr] = z, vis[z] = 1;
    }
    if (qr > m) return 0;
  }
  return !(ql <= qr);
}
inline void check() {
  int i;
  for (i = 1; i <= n; ++i)
    if (!ok[i]) ok[i] |= solve(i);
}
bool used[M];
inline void dfs(int dep) {
  if (dep > m) {
    check();
    return;
  }
  for (int i = 1; i <= m; ++i)
    if (!used[i]) {
      used[i] = 1;
      p[dep] = i;
      dfs(dep + 1);
      used[i] = 0;
    }
}
int main() {
  int i, j, k;
  cin >> m >> n;
  for (i = 1; i <= m; ++i) cin >> a[i].x >> a[i].y;
  for (i = 1; i <= n; ++i) cin >> b[i].x >> b[i].y;
  for (i = 1; i <= m; ++i)
    for (j = 1; j <= n; ++j)
      for (k = 1; k <= n; ++k)
        if ((j ^ k) && !check(a[i], b[j], b[k])) {
          G[i][j].push_back(k);
          if (G[i][j].size() >= m) break;
        }
  dfs(1);
  int ans = 0;
  for (i = 1; i <= n; ++i)
    if (ok[i]) ++ans;
  cout << ans << '\n';
  return 0;
}
