#include <bits/stdc++.h>
using namespace std;
long double cross(pair<int, int> a, pair<int, int> b) {
  return (long double)a.first * b.second - (long double)a.second * b.first;
}
long double ccw(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  pair<int, int> p = pair<int, int>(b.first - a.first, b.second - a.second);
  pair<int, int> q = pair<int, int>(c.first - a.first, c.second - a.second);
  return cross(p, q);
}
long long dist(pair<int, int> a, pair<int, int> b) {
  return 1LL * abs(a.first - b.first) + abs(a.second - b.second);
}
bool mid(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  return abs(ccw(a, b, c)) < 1e-7 && dist(a, c) + dist(c, b) == dist(a, b);
}
int K, N;
pair<int, int> R[7], M[1010];
vector<int> need;
int chk[1010], vis[1010], matched[7], rem;
bool dfs() {
  for (int i = 0; i < K; i++)
    if (matched[i] != -1) {
      int u = matched[i];
      bool ok = true;
      for (int j = 0; j < N; j++)
        if (!chk[j] && j != u && mid(R[i], M[u], M[j])) {
          ok = false;
        }
      if (ok) chk[u] = 1;
    }
  while (need.size() && chk[need.back()]) need.pop_back();
  if (need.size() == 0) return true;
  int cnt = 0;
  memset(vis, 0, sizeof(vis));
  for (int i = 0; i < need.size(); i++)
    if (!chk[need[i]] && !vis[need[i]]) cnt++, vis[need[i]] = 1;
  if (cnt > rem) return false;
  int u = need.back();
  need.pop_back();
  for (int i = 0; i < K; i++)
    if (matched[i] == -1) {
      matched[i] = u;
      rem--;
      vector<int> tmp;
      for (int j = 0; j < N; j++)
        if (!chk[j] && j != u && mid(R[i], M[u], M[j])) {
          tmp.push_back(j);
        }
      vector<int> res = need;
      for (int j = 0; j < tmp.size(); j++) need.push_back(tmp[j]);
      if (tmp.size() == 0) chk[u] = 1;
      if (dfs()) return true;
      chk[u] = 0;
      need = res;
      matched[i] = -1;
      rem++;
    }
  return false;
}
int main() {
  scanf("%d %d", &K, &N);
  for (int i = 0; i < K; i++) {
    scanf("%d %d", &R[i].first, &R[i].second);
  }
  for (int i = 0; i < N; i++) {
    scanf("%d %d", &M[i].first, &M[i].second);
  }
  int ans = 0;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < K; j++) {
      memset(matched, -1, sizeof(matched));
      memset(chk, 0, sizeof(chk));
      need.clear();
      need.push_back(i);
      rem = K;
      if (dfs()) {
        ans++;
        break;
      }
    }
  }
  printf("%d", ans);
}
