#include <bits/stdc++.h>
using namespace std;
const int N = 305;
namespace geometry {
struct Vector {
  long long x, y;
  Vector(long long x = 0, long long y = 0) : x(x), y(y) {}
  bool operator<(const Vector &tmp) const {
    return x != tmp.x ? x < tmp.x : y < tmp.y;
  }
  bool operator==(const Vector &tmp) const { return x == tmp.x && y == tmp.y; }
  Vector operator-(const Vector &tmp) const {
    return Vector(x - tmp.x, y - tmp.y);
  }
  Vector operator*(const long long &k) const { return Vector(x * k, y * k); }
};
long long dot(const Vector &A, const Vector &B) {
  return A.x * B.x + A.y * B.y;
}
long long length2(const Vector &A) { return dot(A, A); }
}  // namespace geometry
using namespace geometry;
int n, m, p[10];
int v[1005], tot;
Vector a[10], b[1005];
vector<int> c[10][1005], g;
bool dfs(int goal) {
  if (tot == m) return 0;
  for (auto x : c[p[tot]][goal])
    if (!v[x]) {
      ++tot;
      if (!dfs(x)) return 0;
    }
  return g.push_back(goal), v[goal] = 1;
}
bool check(int x) {
  for (int i = 0; i < m; ++i) p[i] = i;
  do {
    g.clear();
    tot = 0;
    int o = dfs(x);
    for (auto i : g) v[i] = 0;
    if (o) return 1;
  } while (next_permutation(p, p + m));
  return 0;
}
int fg(long long x) { return x < 0 ? -1 : x == 0 ? 0 : 1; }
const long double eps = 1e-12;
int main() {
  ios::sync_with_stdio(false);
  cin >> m >> n;
  for (int i = 0, x, y; i < m; ++i) {
    cin >> x >> y;
    a[i].x = x, a[i].y = y;
  }
  for (int i = 0, x, y; i < n; ++i) {
    cin >> x >> y;
    b[i].x = x, b[i].y = y;
  }
  for (int i = 0; i < m; ++i)
    for (int j = 0; j < n; ++j) {
      Vector v1 = b[j] - a[i];
      for (int k = 0; k < n; ++k) {
        Vector v2 = b[k] - a[i];
        if (fabs(1.0L * v2.x * v2.x * length2(v1) -
                 1.0L * v1.x * v1.x * length2(v2)) < eps &&
            fabs(1.0L * v2.y * v2.y * length2(v1) -
                 1.0L * v1.y * v1.y * length2(v2)) < eps &&
            fg(v1.x) == fg(v2.x) && fg(v1.y) == fg(v2.y) &&
            length2(v2) < length2(v1))
          c[i][j].push_back(k);
      }
    }
  int ans = 0;
  for (int i = 0; i < n; ++i) ans += check(i);
  cout << ans << endl;
  return 0;
}
