#include <bits/stdc++.h>
using namespace std;
constexpr long long mod = 1000000007;
const long long INF = mod * mod;
const long double eps = 1e-8;
const long double pi = acosl(-1.0);
long long mod_pow(long long x, long long n, long long m = mod) {
  if (n < 0) {
    long long res = mod_pow(x, -n, m);
    return mod_pow(res, m - 2, m);
  }
  if (abs(x) >= m) x %= m;
  if (x < 0) x += m;
  long long res = 1;
  while (n) {
    if (n & 1) res = res * x % m;
    x = x * x % m;
    n >>= 1;
  }
  return res;
}
struct modint {
  long long n;
  modint() : n(0) { ; }
  modint(long long m) : n(m) {
    if (n >= mod)
      n %= mod;
    else if (n < 0)
      n = (n % mod + mod) % mod;
  }
  operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint& a, modint b) {
  a.n += b.n;
  if (a.n >= mod) a.n -= mod;
  return a;
}
modint operator-=(modint& a, modint b) {
  a.n -= b.n;
  if (a.n < 0) a.n += mod;
  return a;
}
modint operator*=(modint& a, modint b) {
  a.n = ((long long)a.n * b.n) % mod;
  return a;
}
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, long long n) {
  if (n == 0) return modint(1);
  modint res = (a * a) ^ (n / 2);
  if (n % 2) res = res * a;
  return res;
}
long long inv(long long a, long long p) {
  return (a == 1 ? 1 : (1 - p * inv(p % a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }
modint operator/=(modint& a, modint b) {
  a = a / b;
  return a;
}
const int max_n = 1 << 1;
modint fact[max_n], factinv[max_n];
void init_f() {
  fact[0] = modint(1);
  for (int i = 0; i < max_n - 1; i++) {
    fact[i + 1] = fact[i] * modint(i + 1);
  }
  factinv[max_n - 1] = modint(1) / fact[max_n - 1];
  for (int i = max_n - 2; i >= 0; i--) {
    factinv[i] = factinv[i + 1] * modint(i + 1);
  }
}
modint comb(int a, int b) {
  if (a < 0 || b < 0 || a < b) return 0;
  return fact[a] * factinv[b] * factinv[a - b];
}
modint combP(int a, int b) {
  if (a < 0 || b < 0 || a < b) return 0;
  return fact[a] * factinv[a - b];
}
pair<long long, long long> input_point() {
  int x, y;
  cin >> x >> y;
  return {x, y};
}
long long dot(pair<long long, long long> a, pair<long long, long long> b) {
  return a.first * b.first + a.second * b.second;
}
long long cross(pair<long long, long long> a, pair<long long, long long> b) {
  return a.first * b.second - a.second * b.first;
}
long long norm2(pair<long long, long long> a) {
  return a.first * a.first + a.second * a.second;
}
int ccw(pair<long long, long long> a, pair<long long, long long> b,
        pair<long long, long long> c) {
  b.first -= a.first;
  b.second -= a.second;
  c.first -= a.first;
  c.second -= a.second;
  if (cross(b, c) > 0) return 1;
  if (cross(b, c) < 0) return -1;
  if (dot(b, c) < 0) return 2;
  if (norm2(b) < norm2(c)) return -2;
  return 0;
}
vector<int> pres[7][1000];
void solve() {
  int k, n;
  cin >> k >> n;
  vector<pair<long long, long long>> a(k);
  for (int i = 0; i < k; i++) {
    a[i] = input_point();
  }
  vector<pair<long long, long long>> b(n);
  for (int i = 0; i < n; i++) {
    b[i] = input_point();
  }
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < n; j++) {
      for (int x = 0; x < n; x++)
        if (j != x) {
          if (ccw(a[i], b[x], b[j]) == -2) {
            pres[i][j].push_back(x);
          }
        }
      if (pres[i][j].size() > k) pres[i][j].resize(k);
    }
  }
  vector<vector<vector<vector<int>>>> cs(1 << k);
  for (int i = 0; i < (1 << k); i++) {
    int cnt = 0;
    for (int j = 0; j < k; j++)
      if (i & (1 << j)) cnt++;
    cs[i].resize(cnt + 1);
    vector<int> ids;
    for (int j = 0; j < k; j++)
      if (i & (1 << j)) ids.push_back(j);
    for (int j = 1; j <= cnt; j++) {
      vector<int> v(cnt, -1);
      for (int k = 0; k < j; k++) v[k] = k;
      sort((v).begin(), (v).end());
      do {
        vector<int> nex(j);
        for (int k = 0; k < cnt; k++)
          if (v[k] >= 0) {
            nex[v[k]] = ids[k];
          }
        cs[i][j].push_back(nex);
      } while (next_permutation((v).begin(), (v).end()));
    }
  }
  vector<int> cnts(1 << k);
  for (int i = 0; i < (1 << k); i++)
    for (int j = 0; j < k; j++)
      if (i & (1 << j)) cnts[i]++;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    vector<bool> used(n);
    vector<int> nex;
    int s = (1 << k) - 1;
    function<bool()> dfs = [&]() -> bool {
      if (nex.empty()) return true;
      int sz = nex.size();
      for (auto& v : cs[s][sz]) {
        int ns = s;
        vector<int> nexs;
        for (int j = 0; j < v.size(); j++) {
          ns ^= (1 << v[j]);
          for (int pid : pres[v[j]][nex[j]]) {
            if (!used[pid]) {
              used[pid] = true;
              nexs.push_back(pid);
            }
          }
        }
        vector<int> cop = nexs;
        if (nexs.size() <= cnts[ns]) {
          swap(nex, nexs);
          swap(s, ns);
          if (dfs()) return true;
          swap(nex, nexs);
          swap(s, ns);
        }
        for (int id : cop) used[id] = false;
      }
      return false;
    };
    nex.push_back(i);
    if (dfs()) ans++;
  }
  cout << ans << "\n";
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(12);
  solve();
  return 0;
}
