#include <bits/stdc++.h>
using namespace std;
int n, k, ds = 0;
pair<int, int> stones[10], monster[1001];
bool fr[1001];
int per[10];
vector<int> g[10][1001];
int deg[10][1001];
pair<int, int> operator-(pair<int, int> a, pair<int, int> b) {
  return pair<int, int>(a.first - b.first, a.second - b.second);
}
long long operator^(pair<int, int> a, pair<int, int> b) {
  long long kq = (long long)a.first * b.first + (long long)a.second * b.second;
  return kq;
}
long long operator*(pair<int, int> a, pair<int, int> b) {
  long long kq = (long long)a.first * b.second - (long long)a.second * b.first;
  return kq;
}
bool ok(pair<int, int> x, pair<int, int> mid, pair<int, int> y) {
  if (((mid - x) * (y - x)) == 0 && ((x - mid) ^ (y - mid)) < 0) return true;
  return false;
}
void doc() {
  cin >> k >> n;
  for (int i = 1; i <= k; i++) cin >> stones[i].first >> stones[i].second;
  for (int i = 1; i <= n; i++) cin >> monster[i].first >> monster[i].second;
  for (int i = 1; i <= k; i++)
    for (int j = 1; j <= n; j++)
      for (int u = 1; u <= n; u++)
        if (u != j && ok(stones[i], monster[u], monster[j])) {
          g[i][j].push_back(u);
          deg[i][j]++;
        }
}
queue<int> s;
void xuli() {
  for (int i = 1; i <= n; i++) {
    bool check = false;
    for (int j = 1; j <= k; j++) per[j] = j;
    do {
      for (int j = 1; j <= n; j++) fr[j] = false;
      while (!s.empty()) s.pop();
      s.push(i);
      fr[i] = true;
      int id = 1, slm = 1;
      while (!s.empty()) {
        int u = s.front();
        s.pop();
        for (int j = 0; j < deg[per[id]][u]; j++) {
          int mid = g[per[id]][u][j];
          if (!fr[mid]) {
            slm++;
            s.push(mid), fr[mid] = true;
            if (slm > k) goto sss;
          }
        }
        ++id;
        if (s.empty()) {
          check = true;
          goto lan;
        }
        if (id > k) break;
      }
    sss:;
    } while (next_permutation(per + 1, per + k + 1));
  lan:;
    ds += check;
  }
  cout << ds << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  doc();
  xuli();
}
