#include <bits/stdc++.h>
using namespace std;
int k, n, ans, done[1234];
long long fx[7], fy[7], tx[1234], ty[1234];
vector<int> blk[7][1234];
bool block(int f, int t, int b) {
  if (t == b) return 0;
  if (!(abs(fx[f] - tx[b]) + abs(fy[f] - ty[b]) <
        abs(fx[f] - tx[t]) + abs(fy[f] - ty[t])))
    return 0;
  if ((fx[f] - tx[b]) * (fy[f] - ty[t]) != (fx[f] - tx[t]) * (fy[f] - ty[b]))
    return 0;
  if ((fx[f] - tx[b] > 0) != (fx[f] - tx[t]) > 0) return 0;
  if ((fy[f] - ty[b] > 0) != (fy[f] - ty[t]) > 0) return 0;
  return 1;
}
bool slv(vector<int> aim, int rem) {
  if (aim.empty()) return 1;
  if (aim.size() > __builtin_popcount(rem)) return 0;
  int cur = aim[0];
  for (int i = (0); i < (k); i++)
    if (rem & (1 << i)) {
      vector<int> aimn;
      for (int a : aim)
        if (a != cur) aimn.push_back(a);
      vector<int> remdone;
      for (int a : blk[i][cur])
        if (!done[a]) aimn.push_back(a), done[a] = 1, remdone.push_back(a);
      bool can = slv(aimn, rem ^ (1 << i));
      for (int a : remdone) done[a] = 0;
      if (can) return 1;
    }
  return 0;
}
int main() {
  scanf("%d %d", &k, &n);
  for (int i = (0); i < (k); i++) scanf("%lld %lld", fx + i, fy + i);
  for (int i = (0); i < (n); i++) scanf("%lld %lld", tx + i, ty + i);
  for (int f = (0); f < (k); f++)
    for (int t = (0); t < (n); t++)
      for (int b = (0); b < (n); b++) {
        if (block(f, t, b)) {
          blk[f][t].push_back(b);
          if (blk[f][t].size() >= k) break;
        }
      }
  for (int i = (0); i < (n); i++) {
    done[i] = 1;
    vector<int> aim;
    aim.push_back(i);
    if (slv(aim, (1 << k) - 1)) ans++;
    done[i] = 0;
  }
  printf("%d\n", ans);
  return 0;
}
