#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int k, n, ans, d[N][10], fr[N][10], mi[N], w[N];
int nd[10], K;
map<pair<int, int>, int> A;
pair<int, int> a[N], b[10];
long long aa[N];
vector<int> o;
bool bz[N], ex[N], can[N];
int gcd(int first, int second) {
  for (; second; second %= first) swap(first, second);
  return first;
}
bool cmp(int first, int second) { return aa[first] < aa[second]; }
bool cmp2(int first, int second) { return d[K][nd[first]] < d[K][nd[second]]; }
long long dis(pair<int, int> a) {
  return (long long)a.first * a.first + (long long)a.second * a.second;
}
bool work(vector<int> a, int st) {
  if (!a.size()) return 1;
  if (a.size() > k - st + 1) return 0;
  sort(a.begin(), a.end(), cmp);
  vector<int> b, c, cl;
  b.clear();
  c.clear();
  for (int i = 0, _e = a.size() - 2; i <= _e; ++i) b.push_back(a[i]);
  for (int i = st, _e = k; i <= _e; ++i) c.push_back(i);
  K = a.back();
  sort(c.begin(), c.end(), cmp2);
  int z;
  bool ca = 0;
  for (int i : c) {
    cl.clear();
    ca = 0;
    for (z = a.back(); z = fr[z][nd[i]];)
      if (!ex[z]) cl.push_back(z), ex[z] = 1, ca |= can[z];
    if (cl.size() + b.size() <= k - st && !ca) {
      for (int j : cl) b.push_back(j);
      swap(nd[i], nd[st]);
      if (work(b, st + 1)) {
        bz[a.back()] = 1;
        for (int j : cl) ex[j] = 0;
        return 1;
      }
      swap(nd[i], nd[st]);
      for (int j : cl) b.pop_back();
    }
    for (int j : cl) ex[j] = 0;
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> k >> n;
  for (int i = 1, _e = k; i <= _e; ++i) cin >> b[i].first >> b[i].second;
  for (int i = 1, _e = n; i <= _e; ++i) cin >> a[i].first >> a[i].second;
  for (int i = 1, _e = k; i <= _e; ++i) {
    A.clear();
    for (int j = 1, _e = n; j <= _e; ++j)
      w[j] = j, aa[j] = dis(pair<int, int>(a[j].first - b[i].first,
                                           a[j].second - b[i].second));
    sort(w + 1, w + n + 1, cmp);
    for (int k = 1, _e = n; k <= _e; ++k) {
      int j = w[k];
      pair<int, int> c =
          pair<int, int>(a[j].first - b[i].first, a[j].second - b[i].second);
      int gc = gcd(((c.first) > 0 ? c.first : -(c.first)),
                   ((c.second) > 0 ? c.second : -(c.second)));
      c.first /= gc;
      c.second /= gc;
      if (A.count(c)) fr[j][i] = A[c], d[j][i] = d[fr[j][i]][i] + 1;
      A[c] = j;
    }
  }
  for (int i = 1, _e = n; i <= _e; ++i) {
    mi[i] = d[i][1];
    for (int j = 2, _e = k; j <= _e; ++j) mi[i] = min(mi[i], d[i][j]);
  }
  for (int i = 1, _e = n; i <= _e; ++i) w[i] = i, aa[i] = mi[i];
  sort(w + 1, w + n + 1, cmp);
  o.resize(1);
  for (int i = 1, _e = k; i <= _e; ++i) nd[i] = i;
  for (int i = n, _e = 1; i >= _e; --i) {
    int j = w[i];
    if (mi[j] + 1 <= k && !bz[j]) {
      o[0] = j;
      ex[j] = 1;
      work(o, 1);
      if (!bz[j]) can[j] = 1;
      ex[j] = 0;
    }
  }
  for (int i = 1, _e = n; i <= _e; ++i)
    if (bz[i]) ++ans;
  cout << ans;
}
