#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar()) {
    if (ch == '-') f = -1;
  }
  for (; isdigit(ch); ch = getchar()) {
    x = x * 10 + ch - 48;
  }
  return x * f;
}
const int N = 1000;
const int M = 7;
struct Point {
  int x, y;
} a[M + 2], b[N + 3];
vector<int> l[M + 2][N + 3];
int permu[M + 2];
int que[N + 3];
bool vis[N + 3];
int n, m;
int main() {
  scanf("%d%d", &m, &n);
  for (int i = 1; i <= m; i++) scanf("%d%d", &a[i].x, &a[i].y);
  for (int i = 1; i <= n; i++) scanf("%d%d", &b[i].x, &b[i].y);
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      for (int k = 1; k <= n; k++)
        if (k != j) {
          if (1ll * (b[j].x - a[i].x) * (b[k].y - a[i].y) ==
                  1ll * (b[j].y - a[i].y) * (b[k].x - a[i].x) &&
              (1ll * (a[i].x - b[k].x) * (b[j].x - b[k].x) < 0 ||
               (a[i].x == b[k].x &&
                1ll * (a[i].y - b[k].y) * (b[j].y - b[k].y) < 0))) {
            l[i][j].push_back(k);
          }
        }
    }
  }
  int fans = 0;
  for (int j = 1; j <= n; j++) {
    for (int i = 1; i <= m; i++) permu[i] = i;
    bool ans = false;
    do {
      for (int i = 1; i <= n; i++) vis[i] = false;
      bool cur = true;
      int hd = 1, tl = 1;
      que[tl] = j;
      vis[j] = true;
      while (hd <= tl) {
        int u = que[hd];
        for (int i = 0; i < l[permu[hd]][u].size(); i++) {
          if (vis[l[permu[hd]][u][i]]) continue;
          que[++tl] = l[permu[hd]][u][i];
          vis[l[permu[hd]][u][i]] = true;
          if (tl > m) {
            cur = false;
            break;
          }
        }
        if (!cur) {
          break;
        }
        hd++;
      }
      if (cur) {
        ans = true;
        break;
      }
    } while (next_permutation(permu + 1, permu + m + 1));
    if (ans) {
      fans++;
    }
  }
  printf("%d\n", fans);
  return 0;
}
