#include <bits/stdc++.h>
using namespace std;
int A[10][2], M[1010][2];
bool need[1010][10][1010];
bool onseg(int xs, int ys, int xe, int ye, int x, int y) {
  if (x < min(xs, xe) || x > max(xs, xe)) return false;
  if (y < min(ys, ye) || y > max(ys, ye)) return false;
  int dx1 = x - xs, dx2 = xe - x;
  int dy1 = y - ys, dy2 = ye - y;
  return (long long)dx1 * dy2 == (long long)dx2 * dy1;
}
int N, K;
int must[1010];
bool def[1010], arr[10];
bool kill(int m, int a, int ra) {
  int rem = 0;
  for (int i = 1; i <= N; i++)
    if (must[i] > 0 && !def[i]) rem++;
  if (rem > ra) return false;
  if (rem == 0) return true;
  for (int i = 1; i <= N; i++) {
    if (must[i] > 0 && !def[i]) {
      bool val = true;
      for (int j = 1; j <= K; j++) {
        if (arr[j]) continue;
        for (int k = 1; k <= N; k++) {
          if (need[i][j][k]) {
            must[k]++;
            if (def[k]) val = false;
          }
        }
        def[i] = true;
        arr[j] = true;
        bool res = (val && kill(i, j, ra - 1));
        def[i] = false;
        arr[j] = false;
        for (int k = 1; k <= N; k++)
          if (need[i][j][k]) must[k]--;
        if (res) return true;
      }
    }
  }
  return false;
}
int main() {
  scanf("%d%d", &K, &N);
  for (int i = 1; i <= K; i++) scanf("%d%d", &A[i][0], &A[i][1]);
  for (int i = 1; i <= N; i++) scanf("%d%d", &M[i][0], &M[i][1]);
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= K; j++) {
      for (int k = 1; k <= N; k++) {
        if (k == i) continue;
        if (onseg(A[j][0], A[j][1], M[i][0], M[i][1], M[k][0], M[k][1]))
          need[i][j][k] = true;
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= K; j++) {
      for (int k = 1; k <= N; k++)
        if (need[i][j][k]) must[k]++;
      def[i] = true;
      arr[j] = true;
      bool res = kill(i, j, K - 1);
      for (int k = 1; k <= N; k++)
        if (need[i][j][k]) must[k]--;
      def[i] = false;
      arr[j] = false;
      if (res) {
        ans++;
        break;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
