#include <bits/stdc++.h>
using namespace std;
struct p {
  long long y, x;
};
bool cln(p a, p b, p c) {
  long long t = (b.y - a.y) * (c.x - a.x) - (b.x - a.x) * (c.y - a.y);
  if (t != 0) return false;
  if (a.x == b.x) {
    if (a.y <= b.y && b.y <= c.y) return true;
    swap(a, c);
    if (a.y <= b.y && b.y <= c.y) return true;
    return false;
  }
  if (a.x <= b.x && b.x <= c.x) return true;
  swap(a, c);
  if (a.x <= b.x && b.x <= c.x) return true;
  return false;
}
p s[10];
p m[1005];
int n, k;
vector<int> v[10][1005];
bool bd[10][1005];
int p[10];
int l[70];
int lf, le;
int ht[1005], T;
int main() {
  scanf("%d %d", &k, &n);
  for (int i = (0); i < (k); i++) {
    scanf("%lld %lld", &s[i].x, &s[i].y);
  }
  for (int i = (0); i < (n); i++) {
    scanf("%lld %lld", &m[i].x, &m[i].y);
  }
  for (int i = (0); i < (k); i++)
    for (int j = (0); j < (n); j++) {
      for (int l = (0); l < (n); l++)
        if (l != j && cln(s[i], m[l], m[j])) {
          v[i][j].push_back(l);
        }
      if (int(v[i][j].size()) >= 7) {
        v[i][j].clear();
        v[i][j].shrink_to_fit();
        bd[i][j] = true;
      }
    }
  int ans = 0;
  for (int i = (0); i < (n); i++) {
    for (int j = (0); j < (k); j++) p[j] = j;
    bool found = false;
    do {
      lf = le = 0;
      l[le++] = i;
      T++;
      ht[i] = T;
      for (int j = (0); j < (k); j++) {
        if (le == lf) break;
        int wm = l[lf++];
        if (bd[p[j]][wm]) goto notfound;
        for (int x : v[p[j]][wm])
          if (ht[x] != T) {
            ht[x] = T;
            l[le++] = x;
          }
        if (le > 10) goto notfound;
      }
      if (le == lf) {
        found = true;
        break;
      }
    notfound:;
    } while (next_permutation(p, p + k));
    if (found) ans++;
  }
  printf("%d\n", ans);
}
