#include <bits/stdc++.h>
using namespace std;
int rd() {
  char c = getchar();
  int t = 0, f = 1;
  while (!isdigit(c)) f = (c == '-') ? -1 : 1, c = getchar();
  while (isdigit(c)) t = t * 10 + c - 48, c = getchar();
  return t * f;
}
void wt(int first) {
  if (first < 0)
    putchar('-'), wt(-first);
  else {
    if (first > 9) wt(first / 10);
    putchar(first % 10 + 48);
  }
}
const int N = 1035;
long long dis(pair<long long, long long> A, pair<long long, long long> B) {
  return (A.first - B.first) * (A.first - B.first) +
         (A.second - B.second) * (A.second - B.second);
}
long long mul(pair<long long, long long> O, pair<long long, long long> A,
              pair<long long, long long> B) {
  return (A.first - O.first) * (B.second - O.second) -
         (A.second - O.second) * (B.first - O.first);
}
pair<long long, long long> A[N], P[N];
int q[N], r[N], K, n, ans, g[N][11][11];
bool dfs(int top, int t) {
  if (!top) return 1;
  if (K - t + 1 < top) return 0;
  int _q[10];
  for (int i = ((int)1); i <= ((int)top); i++) _q[i] = q[i];
  for (int i = ((int)1); i <= ((int)top); i++) {
    int new_top = 0;
    for (int j = ((int)1); j <= ((int)top); j++)
      if (j != i) q[++new_top] = _q[j];
    for (int j = ((int)1); j <= ((int)*g[_q[i]][r[t]]); j++)
      q[++new_top] = g[_q[i]][r[t]][j];
    sort(q + 1, q + new_top + 1),
        new_top = unique(q + 1, q + new_top + 1) - q - 1;
    if (dfs(new_top, t + 1)) return 1;
    for (int j = ((int)1); j <= ((int)top); j++) q[i] = _q[i];
  }
  return 0;
}
int main() {
  K = rd(), n = rd();
  for (int i = ((int)1); i <= ((int)K); i++)
    P[i].first = rd(), P[i].second = rd();
  for (int i = ((int)1); i <= ((int)n); i++)
    A[i].first = rd(), A[i].second = rd();
  for (int i = ((int)1); i <= ((int)K); i++)
    for (int j = ((int)1); j <= ((int)n); j++)
      for (int k = ((int)1); k <= ((int)n); k++)
        if (j != k) {
          long long len = dis(P[i], A[j]);
          long long len1 = dis(P[i], A[k]), len2 = dis(A[j], A[k]);
          if (mul(P[i], A[j], A[k]) == 0 && len1 < len && len2 < len)
            g[j][i][++*g[j][i]] = k;
          if (*g[j][i] == K) break;
        }
  for (int i = ((int)1); i <= ((int)n); i++) {
    for (int j = ((int)1); j <= ((int)K); j++) r[j] = j;
    do {
      q[1] = i;
      if (dfs(1, 1)) {
        ans++;
        break;
      }
    } while (next_permutation(r + 1, r + K + 1));
  }
  printf("%d\n", ans);
  return 0;
}
