#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T &x) {
  char ch;
  bool flag = false;
  while (!isdigit(ch = getchar())) flag |= ch == '-';
  for (x = ch ^ 48; isdigit(ch = getchar()); x = x * 10 + (ch ^ 48))
    ;
  if (flag) x = -x;
}
inline int input() {
  int x;
  char ch;
  bool flag = false;
  while (!isdigit(ch = getchar())) flag |= ch == '-';
  for (x = ch ^ 48; isdigit(ch = getchar()); x = x * 10 + (ch ^ 48))
    ;
  return flag ? -x : x;
}
const int mod = 1e9 + 7;
inline int add(int x, int y) {
  x += y;
  return x >= mod ? x - mod : x;
}
inline void inc(int &x, int y) {
  x += y;
  x -= x >= mod ? mod : 0;
}
inline int Power(int x, int y) {
  int res = 1;
  while (y) {
    if (y & 1) res = (long long)res * x % mod;
    x = (long long)x * x % mod, y >>= 1;
  }
  return res;
}
template <class T>
void chkmax(T &x, T y) {
  x = x > y ? x : y;
}
template <class T>
void chkmin(T &x, T y) {
  x = x < y ? x : y;
}
template <class T>
T gcd(T x, T y) {
  return !y ? x : gcd(x % y, y);
}
int k, n;
long long xa[10], ya[10];
long long xb[1005], yb[1005];
vector<int> T[8][1005];
bool vis[1005];
int S[1005], tot, use[1005], cnt;
int p[10];
void prework() {
  for (int i = 1; i <= k; ++i)
    for (int j = 1; j <= n; ++j) {
      for (int h = 1; h <= n; ++h) {
        if (h == j) continue;
        if (xa[i] < xb[j] && (xb[h] < xa[i] || xb[h] > xb[j])) continue;
        if (xa[i] > xb[j] && (xb[h] > xa[i] || xb[h] < xb[j])) continue;
        if (ya[i] < yb[j] && (yb[h] < ya[i] || yb[h] > yb[j])) continue;
        if (ya[i] > yb[j] && (yb[h] > ya[i] || yb[h] < yb[j])) continue;
        if ((ya[i] - yb[j]) * (xb[j] - xb[h]) ==
            (yb[j] - yb[h]) * (xa[i] - xb[j]))
          T[i][j].push_back(h);
      }
    }
}
bool dfs(int now) {
  if (!tot) return true;
  if (now > k) return false;
  int tmp = S[tot--];
  for (int j : T[p[now]][tmp])
    if (!vis[j]) {
      S[++tot] = j, use[++cnt] = j, vis[j] = true;
      if (cnt > k) return false;
    }
  return dfs(now + 1);
}
bool check(int x) {
  for (int i = 1; i <= k; ++i) p[i] = i;
  do {
    for (int i = 1; i <= cnt; ++i) vis[use[i]] = false;
    S[tot = 1] = use[cnt = 1] = x;
    if (dfs(1)) return true;
  } while (next_permutation(p + 1, p + k + 1));
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> k >> n;
  for (int i = 1; i <= k; ++i) cin >> xa[i] >> ya[i];
  for (int i = 1; i <= n; ++i) cin >> xb[i] >> yb[i];
  prework();
  int ans = 0;
  for (int i = 1; i <= n; ++i)
    if (check(i)) ++ans;
  printf("%d\n", ans);
  return 0;
}
