#include <bits/stdc++.h>
using namespace std;
const int K = 7, N = 1000;
int k, n;
pair<int, int> a[K + 1], m[N + 1];
vector<int> v[K + 1][N + 1];
int p[K + 1];
bool vis[N + 1];
int res;
bool block(pair<int, int> x, pair<int, int> y, pair<int, int> z) {
  if (y == z) {
    return false;
  }
  if ((z.first < min(x.first, y.first)) || (z.first > max(x.first, y.first))) {
    return false;
  }
  if ((z.second < min(x.second, y.second)) ||
      (z.second > max(x.second, y.second))) {
    return false;
  }
  return 1ll * (y.second - x.second) * (z.first - x.first) ==
         1ll * (z.second - x.second) * (y.first - x.first);
}
int cnt;
bool dfs(int x) {
  if (cnt > k) {
    return false;
  }
  for (int y : v[p[cnt]][x]) {
    if (vis[y]) {
      continue;
    }
    ++cnt;
    if (!dfs(y)) {
      return false;
    }
  }
  vis[x] = true;
  return true;
}
int main() {
  scanf("%d%d", &k, &n);
  for (int i = 1; i <= k; ++i) {
    scanf("%d%d", &a[i].first, &a[i].second);
  }
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &m[i].first, &m[i].second);
  }
  for (int i = 1; i <= k; ++i) {
    for (int j = 1; j <= n; ++j) {
      for (int k = 1; (k <= n) && (v[i][j].size() < ::k); ++k) {
        if (block(a[i], m[j], m[k])) {
          v[i][j].push_back(k);
        }
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= k; ++j) {
      p[j] = j;
    }
    do {
      fill(vis + 1, vis + n + 1, false);
      if (cnt = 1, dfs(i)) {
        ++res;
        break;
      }
    } while (next_permutation(p + 1, p + k + 1));
  }
  printf("%d\n", res);
  return 0;
}
