#include <bits/stdc++.h>
using namespace std;
struct Point {
  long double x, y;
  long double len2() { return x * x + y * y; }
  Point() { x = y = 0; }
  Point(long double X, long double Y) {
    x = X;
    y = Y;
  }
};
Point operator+(Point a, Point b) { return Point(a.x + b.x, a.y + b.y); }
Point operator*(Point a, long double c) { return Point(a.x * c, a.y * c); }
Point operator*(long double c, Point a) { return a * c; }
Point operator-(Point a, Point b) { return Point(a.x - b.x, a.y - b.y); }
long double operator*(Point a, Point b) { return a.x * b.y - a.y * b.x; }
long double dist2(Point a, Point b) { return (a - b).len2(); }
bool is_on_line(Point a, Point b, Point c) { return !((b - a) * (c - a)); }
int k, n;
Point Stn[7], M[1000];
vector<int> need[7][1000], order;
int cur;
bool killed[1000], was[1000], used[7], fear[1000];
bool try_to_kill(int st, int id, int m) {
  if (was[m]) return false;
  was[m] = true;
  int next(id + 1);
  int tmp = need[st][m].size();
  for (int i(0); i < need[st][m].size(); ++i) {
    if (killed[need[st][m][i]]) continue;
    while (next < k && used[order[next]]) next++;
    if (next == k) return false;
    if (!try_to_kill(order[next], next, need[st][m][i])) return false;
  }
  killed[m] = true;
  fear[m] = true;
  used[st] = true;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> k >> n;
  for (int i(0); i < k; ++i) {
    cin >> Stn[i].x >> Stn[i].y;
  }
  for (int i(0); i < n; ++i) {
    cin >> M[i].x >> M[i].y;
  }
  for (int i(0); i < k; ++i)
    for (int j(0); j < n; ++j)
      for (int f(0); f < n; ++f) {
        if (j == f) continue;
        if (is_on_line(Stn[i], M[j], M[f])) {
          if (dist2(Stn[i], M[j]) < dist2(Stn[i], M[f]) &&
              dist2(M[j], M[f]) < dist2(M[f], Stn[i]))
            need[i][f].push_back(j);
        }
      }
  int ans(0);
  for (int i(0); i < k; ++i) order.push_back(i);
  do {
    for (int i(0); i < n; ++i) {
      if (fear[i]) continue;
      memset(was, 0, sizeof was);
      memset(used, 0, sizeof used);
      memset(killed, 0, sizeof killed);
      if (try_to_kill(order[0], 0, i))
        ;
    }
  } while (next_permutation(order.begin(), order.end()));
  for (int i(0); i < n; ++i) ans += fear[i];
  cout << ans;
  return 0;
}
