#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) { cout << endl; }
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << " ";
  err(++it, args...);
}
template <typename T>
inline void read(T& x) {
  x = 0;
  T f = 1;
  char ch = getchar();
  while (!isdigit(ch)) f = (ch == '-') ? -1 : 1, ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar();
  x *= f;
}
template <typename T, typename... Args>
inline void read(T& x, Args&... args) {
  read(x), read(args...);
}
struct Vec2 {
  Vec2() = default;
  Vec2(long long _x, long long _y) : x(_x), y(_y) {}
  long long normSquare() { return x * x + y * y; }
  friend inline bool operator<(const Vec2& a, const Vec2& b) {
    return a.x == b.x ? a.y < b.y : a.x < b.x;
  }
  friend inline Vec2 operator-(const Vec2& a, const Vec2& b) {
    return Vec2(a.x - b.x, a.y - b.y);
  }
  friend inline long long operator*(const Vec2& a, const Vec2& b) {
    return a.x * b.y - a.y * b.x;
  }
  friend inline long long dot(const Vec2& a, const Vec2& b) {
    return a.x * b.x + a.y * b.y;
  }
  long long x = 0, y = 0;
};
constexpr long long MAXN = 1e3 + 3, MOD = 1e9 + 7;
long long n, k, ans;
Vec2 stone[10], m[MAXN];
vector<long long> between[MAXN][8];
array<long long, MAXN> killed, vis;
void init() {
  for (long long cur = 1; cur <= n; cur++) {
    for (long long i = 1; i <= k; i++) {
      for (long long other = 1; other <= n; other++) {
        if (cur == other) continue;
        if ((stone[i] - m[other]) * (stone[i] - m[cur]) != 0) continue;
        if (dot(stone[i] - m[cur], m[other] - m[cur]) < 0) continue;
        if (dot(m[cur] - m[other], m[other] - stone[i]) < 0) continue;
        between[cur][i].emplace_back(other);
      }
    }
  }
}
void BFS(long long i, const vector<long long>& order, long long id = 0) {
  if (killed[i]) return;
  queue<long long> q;
  vector<long long> vec;
  q.push(i), vis[i] = true, vec.push_back(i);
  while (!q.empty()) {
    long long cur = q.front();
    q.pop();
    bool judge = false;
    for (auto& mons : between[cur][order[id]]) {
      if (vis[mons]) continue;
      q.push(mons), vis[mons] = true, vec.push_back(mons);
      if (q.size() >= k) break;
    }
    if (q.size() >= k) break;
    if ((++id) >= k) break;
  }
  for (auto& mons : vec) vis[mons] = false;
  killed[i] |= q.empty();
}
signed main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  cin >> k >> n;
  vector<long long> order;
  for (long long i = 1; i <= k; i++)
    cin >> stone[i].x >> stone[i].y, order.push_back(i);
  for (long long i = 1; i <= n; i++) cin >> m[i].x >> m[i].y;
  init();
  do {
    for (long long i = 1; i <= n; i++) BFS(i, order);
  } while (next_permutation(order.begin(), order.end()));
  for (long long i = 1; i <= n; i++)
    if (killed[i]) ans++;
  cout << ans << "\n";
  return 0;
}
