#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& _p) {
  return os << "(" << _p.first << "," << _p.second << ")";
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& _V) {
  bool f = true;
  os << "[";
  for (auto v : _V) {
    os << (f ? "" : ",") << v;
    f = false;
  }
  return os << "]";
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& _S) {
  bool f = true;
  os << "(";
  for (auto s : _S) {
    os << (f ? "" : ",") << s;
    f = false;
  }
  return os << ")";
}
template <typename T, typename U>
ostream& operator<<(ostream& os, const map<T, U>& _M) {
  return os << set<pair<T, U>>(_M.begin(), _M.end());
}
const signed long long INF = 1000000100;
const long double EPS = 1e-9;
const int MAXN = 1042;
pair<signed long long, signed long long> mon[MAXN], pos[10];
int n, k;
std::vector<int> block[10][MAXN];
int ans[MAXN], shot[MAXN];
std::vector<int> perm;
int cur, cnt = 42;
signed long long gcd(signed long long a, signed long long b) {
  return (b == 0 ? a : gcd(b, a % b));
}
pair<signed long long, signed long long> norm(
    pair<signed long long, signed long long> x) {
  int a = x.first, b = x.second;
  int c = gcd(abs(a), abs(b));
  return make_pair(a / c, b / c);
}
signed long long len(pair<signed long long, signed long long> x) {
  signed long long a = x.first, b = x.second;
  return (a * a + b * b);
}
int blocking(pair<signed long long, signed long long> a,
             pair<signed long long, signed long long> b,
             pair<signed long long, signed long long> c) {
  pair<signed long long, signed long long> x =
      make_pair(b.first - a.first, b.second - a.second);
  pair<signed long long, signed long long> y =
      make_pair(c.first - a.first, c.second - a.second);
  if (norm(x) == norm(y) && len(x) < len(y)) return 1;
  return 0;
}
void read_data() {
  ios_base::sync_with_stdio(0);
  cin >> k >> n;
  for (int(i) = (0); (i) < (k); (i)++) cin >> pos[i].first >> pos[i].second;
  for (int(i) = (0); (i) < (n); (i)++) cin >> mon[i].first >> mon[i].second;
}
int go(int trg) {
  if (cur >= k) return 0;
  int p = perm[cur];
  cur++;
  shot[trg] = cnt;
  for (int x : block[p][trg]) {
    if (shot[x] != cnt) {
      if (!go(x)) return 0;
    }
  }
  return 1;
}
void solve() {
  for (int(i) = (0); (i) < (k); (i)++) {
    for (int(j) = (0); (j) < (n); (j)++) {
      for (int(l) = (0); (l) < (n); (l)++) {
        if (blocking(pos[i], mon[l], mon[j])) {
          block[i][j].push_back(l);
        }
      }
    }
  }
  for (int(j) = (0); (j) < (n); (j)++) {
    perm.resize(k);
    for (int(i) = (0); (i) < (k); (i)++) perm[i] = i;
    for (int(i) = (0); (i) < (n); (i)++) shot[i] = 0;
    cur = 0;
    while (42) {
      cnt++;
      cur = 0;
      if (go(j)) ans[j] = 1;
      if (!next_permutation(perm.begin(), perm.end())) break;
    }
  }
  int res = 0;
  for (int(i) = (0); (i) < (n); (i)++) res += ans[i];
  cout << res << "\n";
}
int main() {
  read_data();
  solve();
}
