#include <bits/stdc++.h>
using namespace std;
namespace _ {
bool rEOF = 1;
inline char nc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && rEOF &&
                 (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? (rEOF = 0, EOF)
             : *p1++;
}
template <class _T>
inline bool read(_T &num) {
  char c = nc(), f = 1;
  num = 0;
  while (c < '0' || c > '9') c == '-' && (f = -1), c = nc();
  while (c >= '0' && c <= '9') num = num * 10 + c - '0', c = nc();
  return (bool)(num *= f);
}
inline bool need(char &c) {
  return c >= 'a' && c <= 'z' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z';
}
inline bool read_str(char *a) {
  while ((*a = nc()) && need(*a) && rEOF) ++a;
  *a = '\0';
  return rEOF;
}
}  // namespace _
using namespace _;
vector<int> v[10][1005];
struct node1 {
  long long x, y;
  node1() {}
  node1(long long xx, long long yy) { x = xx, y = yy; }
  node1 operator-(const node1 &b) const { return node1(x - b.x, y - b.y); }
  long long operator^(const node1 &b) const { return x * b.y - y * b.x; }
  long long operator*(const node1 &b) const { return x * b.x + y * b.y; }
};
node1 a[10];
node1 b[1005];
int flag[1005];
bool check(int i, int j, int k) {
  node1 ab = a[i] - b[j];
  node1 bc = b[j] - b[k];
  node1 ac = a[i] - b[k];
  node1 cb = b[k] - b[j];
  node1 ca = b[k] - a[i];
  if ((ab ^ bc) == 0 && (ab * bc) > 0 && (cb * ca) > 0) return 1;
  return 0;
}
int id[10];
int cnt = 0, tot = 0;
int k, n;
bool ck(int x) {
  if (tot == k + 1) return false;
  flag[x] = cnt;
  for (auto y : v[id[tot]][x])
    if (flag[y] < cnt) {
      tot++;
      if (!ck(y)) return false;
    }
  return true;
}
int main() {
  read(k), read(n);
  for (int i = 1; i <= k; i++) read(a[i].x), read(a[i].y);
  for (int i = 1; i <= n; i++) read(b[i].x), read(b[i].y);
  for (int i = 1; i <= k; i++) {
    for (int j = 1; j <= n; j++) {
      for (int z = 1; z <= n; z++) {
        if (j == z) continue;
        if (check(i, z, j)) v[i][j].push_back(z);
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= k; j++) id[j] = j;
    do {
      tot = 1;
      cnt++;
      if (ck(i)) {
        ans++;
        break;
      }
    } while (next_permutation(id + 1, id + k + 1));
  }
  printf("%d\n", ans);
  return 0;
}
