#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const double eps = 1e-9;
const int maxn = 2000;
long long cross(complex<long long> a, complex<long long> b) {
  return imag(conj(a) * b);
}
complex<long long> stone[7];
complex<long long> monster[maxn];
complex<long long> center;
int perm[maxn];
int quad(complex<long long> a) {
  if (real(a) > 0 && imag(a) >= 0) return 0;
  if (real(a) <= 0 && imag(a) > 0) return 1;
  if (real(a) < 0 && imag(a) <= 0) return 2;
  if (real(a) >= 0 && imag(a) < 0) return 3;
  return -1;
}
bool compare(int a, int b) {
  complex<long long> pa = monster[a] - center, pb = monster[b] - center;
  int qa = quad(pa), qb = quad(pb);
  if (qa != qb) return qa < qb;
  long long ar = cross(pa, pb);
  if (ar == 0) return norm(pa) < norm(pb);
  return ar > 0;
}
int ind[7][maxn];
bool afraid[maxn];
bool dead[maxn];
int killed[7], pnt = 0;
int order[7], top;
vector<vector<int> > L[7];
complex<long long> read() {
  long long x, y;
  cin >> x >> y;
  return complex<long long>(x, y);
}
int k, n;
bool myfind(vector<int> &v, int p) {
  for (auto aa : v)
    if (aa == p) return true;
  return false;
}
bool kill(int monster_id) {
  if (top == 0) return false;
  int stone = order[--top], t = 0;
  int dir = ind[stone][monster_id];
  while (L[stone][dir][t] != monster_id)
    if (!dead[L[stone][dir][t]] && !kill(L[stone][dir][t]))
      return false;
    else
      t++;
  killed[pnt++] = monster_id;
  dead[monster_id] = true;
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> k >> n;
  for (int i = 0; i < k; ++i) stone[i] = read();
  for (int i = 0; i < n; ++i) monster[i] = read(), perm[i] = i;
  for (int i = 0; i < k; ++i) {
    center = stone[i];
    sort(perm, perm + n, compare);
    for (int j = 0, k; j < n; j = k) {
      vector<int> I;
      int idx = L[i].size();
      complex<long long> p = monster[perm[j]] - center;
      int q = quad(p);
      for (k = j; k < n; ++k) {
        complex<long long> pp = monster[perm[k]] - center;
        int qq = quad(pp);
        if (qq != q || cross(p, pp) != 0) break;
        ind[i][perm[k]] = idx;
        I.push_back(perm[k]);
      }
      L[i].push_back(I);
    }
  }
  int answer = 0;
  for (int i = 0, afraid; i < n; ++i) {
    afraid = 0;
    for (int j = 0; j < k; ++j) order[j] = j;
    do {
      top = k;
      afraid = kill(i);
      for (int j = 0; j < pnt; ++j) dead[killed[j]] = false;
      pnt = 0;
    } while (!afraid && next_permutation(order, order + k));
    answer += afraid;
  }
  cout << answer << '\n';
  return 0;
}
