#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline T1 max(T1 a, T2 b) {
  return a < b ? b : a;
}
template <typename T1, typename T2>
inline T1 min(T1 a, T2 b) {
  return a < b ? a : b;
}
const char lf = '\n';
namespace ae86 {
const int bufl = 1 << 15;
char buf[bufl], *s = buf, *t = buf;
inline int fetch() {
  if (s == t) {
    t = (s = buf) + fread(buf, 1, bufl, stdin);
    if (s == t) return EOF;
  }
  return *s++;
}
inline int ty() {
  int a = 0;
  int b = 1, c = fetch();
  while (!isdigit(c)) b ^= c == '-', c = fetch();
  while (isdigit(c)) a = a * 10 + c - 48, c = fetch();
  return b ? a : -a;
}
}  // namespace ae86
using ae86::ty;
const int K = 7 + 1, _ = 1007;
struct points {
  long long x, y;
  points(long long x_ = 0, long long y_ = 0) { x = x_, y = y_; }
  void takein() { x = ty(), y = ty(); }
  friend points operator+(points a, points b) {
    return points(a.x + b.x, a.y + b.y);
  }
  friend points operator-(points a, points b) {
    return points(a.x - b.x, a.y - b.y);
  }
};
inline long long dox(points a, points b) { return a.x * b.x + a.y * b.y; }
inline long long cox(points a, points b) { return a.x * b.y - a.y * b.x; }
inline int isbetline(points a, points b, points x) {
  return cox(x - a, b - a) == 0 && cox(a - x, b - x) != 0;
}
int n, m, tps[_];
points tp[K], mp[_];
vector<int> bet[K][_];
int ed[_] = {0}, faded = 0, ned = 0;
int dfs(int now) {
  if (ned >= n) return 0;
  int who = tps[++ned];
  for (auto i : bet[who][now])
    if (ed[i] != faded && !dfs(i)) return 0;
  ed[now] = faded;
  return 1;
}
int main() {
  ios::sync_with_stdio(0), cout.tie(nullptr);
  n = ty(), m = ty();
  for (int i = 1; i <= n; i++) tp[i].takein();
  for (int i = 1; i <= m; i++) mp[i].takein();
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      for (int k = 1; k <= m; k++)
        if (j != k && cox(mp[j] - tp[i], mp[k] - tp[i]) == 0 &&
            dox(mp[j] - mp[k], tp[i] - mp[k]) < 0)
          bet[i][j].emplace_back(k);
  int ans = 0;
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) tps[j] = j;
    do {
      faded++, ned = 0;
      if (dfs(i)) {
        ans++;
        break;
      }
    } while (next_permutation(tps + 1, tps + n + 1));
  }
  cout << ans << lf;
  return 0;
}
