#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
struct Poi {
  int x, y;
  Poi(int x = 0, int y = 0) : x(x), y(y) {}
  void read() { scanf("%d%d", &x, &y); }
  void print() { printf("(%d,%d)", x, y); }
} a[N], b[N];
Poi operator-(Poi a, Poi b) { return (Poi){a.x - b.x, a.y - b.y}; }
inline long long Cross(const Poi &a, const Poi &b) {
  return 1LL * a.x * b.y - 1LL * a.y * b.x;
}
inline long long Dot(const Poi &a, const Poi &b) {
  return 1LL * a.x * b.x + 1LL * a.y * b.y;
}
inline long long Dot(const Poi &a) { return Dot(a, a); }
int n, k, dang[N][10][N], num[N][10];
int now;
int q[10], st[N], top;
bool vis[10], death[N];
int jud[N], times;
void check() {
  times++;
  top = 0;
  jud[now] = times;
  st[++top] = now;
  int j = 1, tmp;
  for (int j = 1; j <= k; j++) {
    tmp = st[top--];
    for (int i = 1; i <= num[tmp][q[j]]; i++)
      if (jud[dang[tmp][q[j]][i]] != times) {
        st[++top] = dang[tmp][q[j]][i];
        jud[dang[tmp][q[j]][i]] = times;
      }
    if (top == 0 || top > k - j) break;
  }
  if (top == 0) death[now] = 1;
}
void dfs(int x) {
  if (death[now]) return;
  if (x == k + 1) {
    check();
    return;
  }
  for (int i = 1; i <= k; i++)
    if (!vis[i]) {
      q[x] = i;
      vis[i] = 1;
      dfs(x + 1);
      q[x] = 0;
      vis[i] = 0;
    }
}
int main() {
  scanf("%d%d", &k, &n);
  for (int i = 1; i <= k; i++) a[i].read();
  for (int i = 1; i <= n; i++) b[i].read();
  Poi v1, v2;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= k; j++) {
      v1 = b[i] - a[j];
      for (int l = 1; l <= n; l++)
        if (l != i) {
          v2 = b[l] - a[j];
          if (Cross(v1, v2) == 0 && Dot(v1, v2) > 0 && Dot(v1) > Dot(v2))
            dang[i][j][++num[i][j]] = l;
        }
    }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    now = i;
    dfs(1);
    if (death[i]) ans++;
  }
  printf("%d\n", ans);
  return 0;
}
