#include <bits/stdc++.h>
using namespace std;
struct Point {
  long long x, y;
  Point(long long x, long long y) : x(x), y(y) {}
  Point() : x(0), y(0) {}
};
Point pos[7];
Point targets[1010];
vector<int> in[7][1010];
int match[7];
int N, K;
void read(int n, Point *p) {
  for (int i = 0; i < n; ++i) {
    cin >> p[i].x >> p[i].y;
  }
}
bool dfs(const vector<int> &v, int mask);
bool dfs_kill(const vector<int> &v, int i, vector<int> &nv, int mask) {
  if (i == v.size()) {
    set<int> unv(nv.begin(), nv.end());
    for (int j = 0; j < K; ++j) {
      if (match[j] != -1 && unv.count(match[j])) {
        unv.erase(match[j]);
      }
    }
    return dfs(vector<int>(unv.begin(), unv.end()), mask);
  }
  for (int j = 0; j < K; ++j) {
    if (mask >> j & 1) {
      if (in[j][v[i]].size() > __builtin_popcount(mask) - 1) {
        continue;
      }
      match[j] = v[i];
      for (int k = 0; k < in[j][v[i]].size(); ++k) {
        nv.emplace_back(in[j][v[i]][k]);
      }
      if (dfs_kill(v, i + 1, nv, mask & ~(1 << j))) {
        return true;
      }
      for (int k = 0; k < in[j][v[i]].size(); ++k) {
        nv.pop_back();
      }
      match[j] = -1;
    }
  }
  return false;
}
bool dfs(const vector<int> &v, int mask) {
  if (__builtin_popcount(mask) < v.size()) return false;
  if (v.size() == 0) {
    return true;
  }
  vector<int> nv;
  if (dfs_kill(v, 0, nv, mask)) return true;
  return false;
}
inline Point operator-(const Point &a, const Point &b) {
  return Point(a.x - b.x, a.y - b.y);
}
inline long long det(const Point &a, const Point &b) {
  return a.x * b.y - a.y * b.x;
}
inline long long dot(const Point &a, const Point &b) {
  return a.x * b.x + a.y * b.y;
}
inline bool online(const Point &p, const Point &a, const Point &b) {
  return det(b - a, p - a) == 0 && dot(a - p, b - p) < 0;
}
int main() {
  while (cin >> K >> N) {
    read(K, pos);
    read(N, targets);
    for (int i = 0; i < K; ++i) {
      for (int j = 0; j < N; ++j) {
        in[i][j].clear();
        for (int k = 0; k < N; ++k)
          if (k != j && online(targets[k], pos[i], targets[j])) {
            in[i][j].emplace_back(k);
          }
      }
    }
    int res = 0;
    for (int i = 0; i < N; ++i) {
      memset(match, -1, sizeof match);
      if (dfs(vector<int>(1, i), (1 << K) - 1)) {
        res++;
      }
    }
    cout << res << endl;
  }
}
