#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  while (a) {
    b %= a;
    swap(a, b);
  }
  return b;
}
struct Vector2D {
  long long x, y;
  Vector2D() {}
  Vector2D(long long x, long long y) : x(x), y(y) {}
};
Vector2D operator-(const Vector2D& lhs, const Vector2D& rhs) {
  return Vector2D(lhs.x - rhs.x, lhs.y - rhs.y);
}
bool operator==(const Vector2D& lhs, const Vector2D& rhs) {
  return lhs.x == rhs.x && lhs.y == rhs.y;
}
Vector2D normalize(const Vector2D& v) {
  const long long g = gcd(abs(v.x), abs(v.y));
  return Vector2D(v.x / g, v.y / g);
}
struct Vector2DHash {
  size_t operator()(const Vector2D& v) const { return v.x * 1000000007 + v.y; }
};
class OrderByLength {
 public:
  OrderByLength(const vector<Vector2D>& targets, const Vector2D& base)
      : targets_(targets), base_(base) {}
  bool operator()(const int lhs_, const int rhs_) const {
    const Vector2D lhs = targets_[lhs_] - base_;
    const Vector2D rhs = targets_[rhs_] - base_;
    return lhs.x * lhs.x + lhs.y * lhs.y < rhs.x * rhs.x + rhs.y * rhs.y;
  }

 private:
  const vector<Vector2D>& targets_;
  const Vector2D& base_;
};
bool check(const vector<Vector2D>& bears, const vector<Vector2D>& targets,
           vector<unordered_map<Vector2D, vector<int>, Vector2DHash> >& maps,
           const int target, const vector<int>& order, int& next,
           vector<int>& killed) {
  if (next == order.size()) return false;
  const int bear = order[next];
  const vector<int>& onLine =
      maps[bear][normalize(targets[target] - bears[bear])];
  for (int nextTarget : onLine) {
    if (target == nextTarget) {
      killed.push_back(target);
      return true;
    }
    if (find(killed.begin(), killed.end(), nextTarget) != killed.end())
      continue;
    if (!check(bears, targets, maps, nextTarget, order, ++next, killed)) break;
  }
  return false;
}
int main() {
  int k, n;
  cin >> k >> n;
  vector<Vector2D> bears(k);
  vector<Vector2D> targets(n);
  for (int i = 0; i < k; ++i) cin >> bears[i].x >> bears[i].y;
  for (int i = 0; i < n; ++i) cin >> targets[i].x >> targets[i].y;
  vector<unordered_map<Vector2D, vector<int>, Vector2DHash> > maps(k);
  for (int i = 0; i < k; ++i) {
    for (int j = 0; j < n; ++j)
      maps[i][normalize(targets[j] - bears[i])].push_back(j);
    for (auto& p : maps[i])
      sort(p.second.begin(), p.second.end(), OrderByLength(targets, bears[i]));
  }
  int res = 0;
  for (int i = 0; i < n; ++i) {
    bool danger = false;
    vector<int> order(k);
    iota(order.begin(), order.end(), 0);
    do {
      vector<int> killed;
      int next = 0;
      danger |= check(bears, targets, maps, i, order, next, killed);
    } while (!danger && next_permutation(order.begin(), order.end()));
    res += danger;
  }
  cout << res << endl;
}
