#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
const int N = 1010;
int k, n, ax[N], ay[N], px[N], py[N];
vector<pair<int, int> > vec[N];
map<pair<int, int>, int> hs;
vector<int> pr[10][N];
int sht[N], vis[N];
int gcd(int x, int y) { return x ? gcd(y % x, x) : y; }
bool dfs(int rm, vector<int> c) {
  if (((int)(c).size()) == 0) return 1;
  if (((int)(c).size()) > rm) return 0;
  for (auto v : c) {
    sht[v] = 1;
    for (int j = 0; j < k; j++)
      if (!vis[j] && ((int)(pr[j][v]).size()) <= 7) {
        vis[j] = 1;
        bool val = 1;
        set<int> d((c).begin(), (c).end());
        d.erase(v);
        for (auto pp : pr[j][v]) {
          d.insert(pp);
          if (((int)(d).size()) > rm) {
            val = 0;
            break;
          }
        }
        if (val) {
          if (dfs(rm - 1, vector<int>((d).begin(), (d).end()))) return 1;
        }
        vis[j] = 0;
      }
    sht[v] = 0;
  }
  return 0;
}
int main() {
  scanf("%d%d", &k, &n);
  for (int i = 0; i < k; i++) scanf("%d%d", ax + i, ay + i);
  for (int i = 0; i < n; i++) scanf("%d%d", px + i, py + i);
  for (int z = 0; z < k; z++) {
    for (int j = 0; j < n + 1; j++) vec[j].clear();
    hs.clear();
    int tot = 0;
    for (int j = 0; j < n; j++) {
      int x = px[j] - ax[z];
      int y = py[j] - ay[z];
      int d = gcd(x, y);
      d = abs(d);
      x /= d;
      y /= d;
      if (!hs.count(make_pair(x, y))) hs[make_pair(x, y)] = tot++;
      vec[hs[make_pair(x, y)]].push_back(make_pair(d, j));
    }
    for (int i = 0; i < tot; i++) {
      sort((vec[i]).begin(), (vec[i]).end());
      vector<int> v;
      for (auto p : vec[i]) {
        pr[z][p.second] = v;
        v.push_back(p.second);
      }
    }
  }
  int ret = 0;
  for (int i = 0; i < n; i++) {
    memset(sht, 0, sizeof(sht));
    memset(vis, 0, sizeof(vis));
    if (dfs(k, vector<int>{i})) ret++;
  }
  printf("%d\n", ret);
}
