#include <bits/stdc++.h>
using namespace std;
struct point {
  int first, second;
  point(int first = 0, int second = 0) : first(first), second(second) {}
  point operator-(point a) { return point(first - a.first, second - a.second); }
  long long operator^(point a) {
    return (long long)first * a.second - (long long)second * a.first;
  }
  long long operator*(point a) {
    return (long long)first * a.first + (long long)second * a.second;
  }
  void input() { scanf("%d%d", &first, &second); }
};
int sgn(long long a) { return (a > 0) - (a < 0); }
point p[1110], q[1110];
int is_on(point a, point b, point c) {
  if (sgn((a - b) ^ (a - c))) return 0;
  return sgn((a - c) * (c - b)) > 0;
}
vector<int> vec[8][1110];
int id[8], k, vst[1110], flag, dp;
int can(int u) {
  if (dp >= k) return 0;
  int j = id[dp++];
  for (int i = 0; i < vec[j][u].size(); i++) {
    if (vst[vec[j][u][i]] != flag) {
      if (!can(vec[j][u][i])) return 0;
    }
  }
  vst[u] = flag;
  return 1;
}
int main() {
  int n;
  scanf("%d%d", &k, &n);
  for (int i = 0; i < k; i++) p[i].input();
  for (int i = 0; i < n; i++) q[i].input();
  for (int i = 0; i < k; i++) {
    for (int j = 0, r; j < n; j++) {
      for (r = 0; r < n; r++)
        if (r != j) {
          if (is_on(p[i], q[j], q[r])) vec[i][j].push_back(r);
          if (vec[i][j].size() >= k) break;
        }
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < k; j++) id[j] = j;
    do {
      ++flag;
      dp = 0;
      if (can(i)) {
        ans++;
        break;
      }
    } while (next_permutation(id, id + k));
  }
  printf("%d\n", ans);
  return 0;
}
