#include <bits/stdc++.h>
using namespace std;
inline void R(int &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x *= f;
}
void Redirect() {
  freopen(".in", "r", stdin);
  freopen(".out", "w", stdout);
}
pair<int, int> operator-(const pair<int, int> &a, const pair<int, int> &b) {
  pair<int, int> ret;
  ret.first = a.first - b.first;
  ret.second = a.second - b.second;
  return ret;
}
int k, n;
pair<int, int> mon[1005];
int ao[10][1005];
pair<int, int> sto[10];
pair<int, int> cur_ori;
int perm[10];
bool kil[1005];
bool tkil[1005];
int ans = 0;
inline int Quadrant(pair<int, int> a) {
  if (a.first >= 0 && a.second > 0)
    return 1;
  else if (a.first < 0 && a.second >= 0)
    return 2;
  else if (a.first <= 0 && a.second < 0)
    return 3;
  else if (a.first > 0 && a.second <= 0)
    return 4;
  puts("!!!");
  return 0;
}
inline long long Dis2(pair<int, int> a) {
  return (long long)a.first * a.first + (long long)a.second * a.second;
}
inline long long Cross(pair<int, int> a, pair<int, int> b) {
  long long flag =
      (long long)a.first * b.second - (long long)a.second * b.first;
  return flag;
}
inline bool ADcmp(pair<int, int> a, pair<int, int> b) {
  int qa = Quadrant(a), qb = Quadrant(b);
  if (qa != qb)
    return qa < qb;
  else {
    long long flag = Cross(a, b);
    if (flag) return flag > 0;
    return Dis2(a) < Dis2(b);
  }
}
inline bool cmp(int a, int b) {
  return ADcmp((mon[a] - cur_ori), (mon[b] - cur_ori));
}
bool Scmp(int a, int b) {
  pair<int, int> pa = mon[a] - cur_ori, push_back = mon[b] - cur_ori;
  int qa = Quadrant(pa), qb = Quadrant(push_back);
  if (qa != qb)
    return qa < qb;
  else
    return Cross(pa, push_back) > 0;
}
stack<int> s;
int shoot(int target, int kth) {
  if (kth == k + 1) return -1;
  int pos = perm[kth];
  s.push(target);
  cur_ori = sto[pos];
  tkil[target] = 1;
  int bg = lower_bound(ao[pos] + 1, ao[pos] + n + 1, target, Scmp) - ao[pos];
  int use = 1;
  for (int i = bg;; i++) {
    if (ao[pos][i] == target) break;
    if (tkil[ao[pos][i]]) continue;
    int need = shoot(ao[pos][i], kth + use);
    if (need == -1)
      return -1;
    else
      use += need;
  }
  return use;
}
int main() {
  R(k);
  R(n);
  for (int i = 1; i <= k; ++i) {
    R(sto[i].first);
    R(sto[i].second);
    perm[i] = i;
  }
  for (int i = 1; i <= n; ++i) {
    R(mon[i].first);
    R(mon[i].second);
    for (int j = 1; j <= k; ++j) {
      ao[j][i] = i;
    }
  }
  for (int i = 1; i <= k; ++i) {
    cur_ori = sto[i];
    sort(ao[i] + 1, ao[i] + n + 1, cmp);
  }
  do {
    for (int i = 1; i <= n; ++i) {
      if (kil[i]) continue;
      while (s.size()) s.pop();
      if (shoot(i, 1) != -1) {
        kil[i] = 1;
        while (s.size()) {
          kil[s.top()] = 1;
          s.pop();
        }
      }
      memset(tkil, 0, sizeof tkil);
    }
  } while (next_permutation(perm + 1, perm + k + 1));
  for (int i = 1; i <= n; ++i) {
    if (kil[i]) ans++;
  }
  printf("%d\n", ans);
}
