#include <bits/stdc++.h>
using namespace std;
const int OO = numeric_limits<int>::max() / 2;
const bool debug = false;
struct pt {
  int x, y;
  pt() {}
  pt(int x, int y) : x(x), y(y) {}
  pt operator+(const pt& p) const { return pt(x + p.x, y + p.y); }
  pt operator-(const pt& p) const { return pt(x - p.x, y - p.y); }
  pt operator*(int d) const { return pt(x * d, y * d); }
  pt operator/(int d) const { return pt(x / d, y / d); }
  long long operator*(const pt& p) const {
    return 1ll * x * p.x + 1ll * y * p.y;
  }
  long long operator%(const pt& p) const {
    return 1ll * x * p.y - 1ll * y * p.x;
  }
  long long norm2() const { return 1ll * x * x + 1ll * y * y; }
};
pt read() {
  int x, y;
  cin >> x >> y;
  return pt(x, y);
}
bool blocks(pt c, pt a, pt b) {
  if ((c - a) % (b - a) != 0) return false;
  if ((c - a) * (b - a) < 0) return false;
  return (c - a) * (b - a) < (b - a) * (b - a);
}
int k, n;
vector<pt> tel, mon;
vector<int> blockers[7][1000];
vector<int> used;
int used_time = 1;
vector<int> perm;
int pos;
string dead_sometime;
bool check(int x) {
  if (pos >= (int((perm).size()))) {
    return false;
  }
  int now = perm[pos];
  pos++;
  for (auto& b : blockers[now][x]) {
    if (used[b] == used_time) continue;
    if (!check(b)) {
      return false;
    }
  }
  used[x] = used_time;
  dead_sometime[x] = 1;
  return true;
}
int main(int argc, char* argv[]) {
  ios::sync_with_stdio(0);
  cin >> k >> n;
  for (int(i) = (0); (i) < (k); (i)++) {
    tel.push_back(read());
  }
  for (int(i) = (0); (i) < (n); (i)++) {
    mon.push_back(read());
  }
  for (int(p) = (0); (p) < (k); (p)++) {
    for (int(i) = (0); (i) < (n); (i)++) {
      for (int(j) = (0); (j) < (n); (j)++) {
        if (i == j) continue;
        if (blocks(mon[j], tel[p], mon[i])) {
          blockers[p][i].push_back(j);
        }
        if (blockers[p][i].size() >= k) {
          break;
        }
      }
    }
  }
  used.assign(n, 0);
  perm.assign(k, 0);
  dead_sometime.assign(n, 0);
  for (int(i) = (0); (i) < (n); (i)++) {
    if (dead_sometime[i]) continue;
    for (int(i) = (0); (i) < (k); (i)++) perm[i] = i;
    do {
      if (perm[0] == 1 && perm[1] == 4 && perm[2] == 3 && i == 2) {
        printf("");
      }
      used_time++;
      pos = 0;
      if (check(i)) {
        dead_sometime[i] = 1;
        break;
      }
    } while (next_permutation(perm.begin(), perm.end()));
  }
  int ans = 0;
  for (int(i) = (0); (i) < (n); (i)++) {
    if (dead_sometime[i]) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
