#include <bits/stdc++.h>
using namespace std;
template <typename T>
struct varray {
  T dl;
  int n;
  T *a;
  int *v;
  int cur;
  void nextVersion() { cur++; }
  T &operator[](int pos) {
    if (v[pos] != cur) {
      v[pos] = cur;
      a[pos] = dl;
    }
    return a[pos];
  }
  varray(int n, T dl) : dl(dl), n(n), cur(0) {
    a = new T[n];
    v = new int[n];
    for (int i = 0; i < n; i++) {
      v[i] = 0;
      a[i] = dl;
    }
    cur = 0;
  }
};
int gcd(int x, int y) {
  while (x) {
    y %= x;
    swap(x, y);
  }
  return y;
}
const int N = 1010;
const int M = 8;
const long double EPS = 1e-5;
vector<pair<int, int> > t, h;
int req[N][M];
long long findDist(pair<int, int> &a, pair<int, int> &b) {
  return (a.first - b.first) * 1ll * (a.first - b.first) +
         (a.second - b.second) * 1ll * (a.second - b.second);
}
pair<int, int> findAngle(int x, int y) {
  int g = gcd(abs(x), abs(y));
  x /= g;
  y /= g;
  return make_pair(x, y);
}
template <typename T1, typename T2>
ostream &operator<<(ostream &o, pair<T1, T2> p) {
  o << "(" << p.first << "; " << p.second << ")";
  return o;
}
varray<int> f(N, 0);
bool dfs(int x, vector<int> &p) {
  int y = x;
  if (f[x]) return true;
  if (p.empty()) return false;
  int a = p[p.size() - 1];
  p.pop_back();
  while (true) {
    x = req[x][a];
    if (x == -1) break;
    if (!dfs(x, p)) return false;
  }
  if (f[y]) {
  } else {
    f[y] = 1;
  }
  return true;
}
int main() {
  int k, n;
  cin >> k >> n;
  for (int i = 0; i < k; i++) {
    int x, y;
    cin >> x >> y;
    t.push_back(make_pair(x, y));
  }
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    h.push_back(make_pair(x, y));
  }
  for (int it = 0; it < k; it++) {
    vector<pair<pair<int, int>, int> > v;
    for (int j = 0; j < n; j++) {
      v.push_back(make_pair(
          findAngle(h[j].first - t[it].first, h[j].second - t[it].second), j));
    }
    sort(v.begin(), v.end());
    for (int i = 0; i < v.size();) {
      int j = i;
      vector<int> x;
      for (; j < v.size() && v[j].first == v[i].first; j++) {
        x.push_back(v[j].second);
      }
      i = j;
      sort(x.begin(), x.end(), [&](int a, int b) {
        long long d1 = findDist(h[a], t[it]);
        long long d2 = findDist(h[b], t[it]);
        return d1 < d2;
      });
      req[x[0]][it] = -1;
      for (int j = 1; j < x.size(); j++) req[x[j]][it] = x[j - 1];
    }
    for (int j = 0; j < n; j++) {
      cerr << t[it] << " -> " << h[j] << " reqs ";
      if (req[j][it] == -1) {
        cerr << "nothing" << endl;
        continue;
      }
      cerr << h[req[j][it]] << endl;
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    bool hit = false;
    vector<int> w;
    for (int i = 0; i < k; i++) w.push_back(i);
    do {
      f.nextVersion();
      vector<int> tmp(w);
      hit |= dfs(i, tmp);
    } while (!hit && next_permutation(w.begin(), w.end()));
    if (hit) {
      cerr << h[i] << " hited" << endl;
      ans++;
    } else {
      cerr << h[i] << " not hited" << endl;
    }
  }
  cout << ans << endl;
  return 0;
}
