#include <bits/stdc++.h>
using namespace std;
inline long long getint() {
  long long _x = 0, _tmp = 1;
  char _tc = getchar();
  while ((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar();
  if (_tc == '-') _tc = getchar(), _tmp = -1;
  while (_tc >= '0' && _tc <= '9') _x *= 10, _x += (_tc - '0'), _tc = getchar();
  return _x * _tmp;
}
inline long long add(long long _x, long long _y,
                     long long _mod = 1000000007ll) {
  long long _ = _x + _y;
  if (_ >= _mod) _ -= _mod;
  return _;
}
inline long long sub(long long _x, long long _y,
                     long long _mod = 1000000007ll) {
  long long _ = _x - _y;
  if (_ < 0) _ += _mod;
  return _;
}
inline long long mul(long long _x, long long _y,
                     long long _mod = 1000000007ll) {
  long long _ = _x * _y;
  if (_ >= _mod) _ %= _mod;
  return _;
}
long long mypow(long long _a, long long _x, long long _mod) {
  if (_x == 0) return 1ll;
  long long _tmp = mypow(_a, _x / 2, _mod);
  _tmp = mul(_tmp, _tmp, _mod);
  if (_x & 1) _tmp = mul(_tmp, _a, _mod);
  return _tmp;
}
long long mymul(long long _a, long long _x, long long _mod) {
  if (_x == 0) return 0ll;
  long long _tmp = mymul(_a, _x / 2, _mod);
  _tmp = add(_tmp, _tmp, _mod);
  if (_x & 1) _tmp = add(_tmp, _a, _mod);
  return _tmp;
}
inline bool equal(double _x, double _y) {
  return _x > _y - 1e-9 && _x < _y + 1e-9;
}
int __ = 1, _cs;
inline pair<long long, long long> operator-(
    const pair<long long, long long>& p1,
    const pair<long long, long long>& p2) {
  return {p1.first - p2.first, p1.second - p2.second};
}
inline long long operator*(const pair<long long, long long>& p1,
                           const pair<long long, long long>& p2) {
  return p1.first * p2.first + p1.second * p2.second;
}
inline long long operator^(const pair<long long, long long>& p1,
                           const pair<long long, long long>& p2) {
  return p1.first * p2.second - p1.second * p2.first;
}
inline long long norm2(const pair<long long, long long>& tp) { return tp * tp; }
void build() {}
int k, n;
pair<long long, long long> a[8], p[1010];
void scan(pair<long long, long long>& tp) {
  tp.first = getint();
  tp.second = getint();
}
vector<pair<pair<long long, long long>, int> > v[8];
int reg(const pair<long long, long long>& tp) {
  assert(tp.first != 0 || tp.second != 0);
  return tp.second > 0 || (tp.second == 0 && tp.first >= 0);
}
inline bool same_dir(const pair<long long, long long>& p1,
                     const pair<long long, long long>& p2) {
  return (p1 * p2) > 0 && (p1 ^ p2) == 0;
}
bool cmp(const pair<pair<long long, long long>, int>& p1,
         const pair<pair<long long, long long>, int>& p2) {
  if (reg(p1.first) != reg(p2.first)) return reg(p1.first) < reg(p2.first);
  long long ret = p1.first ^ p2.first;
  if (ret != 0) return ret > 0;
  return norm2(p1.first) < norm2(p2.first);
}
int pos[8][1010], st[8][1010];
void init() {
  k = getint();
  n = getint();
  for (int i = 0; i < k; i++) scan(a[i]);
  for (int i = 0; i < n; i++) scan(p[i]);
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < n; j++) v[i].push_back({p[j] - a[i], j});
    sort((v[i]).begin(), (v[i]).end(), cmp);
    pos[i][v[i][0].second] = 0;
    st[i][v[i][0].second] = 0;
    for (int j = 1; j < n; j++) {
      pos[i][v[i][j].second] = j;
      if (same_dir(v[i][j].first, v[i][j - 1].first))
        st[i][v[i][j].second] = st[i][v[i][j - 1].second];
      else
        st[i][v[i][j].second] = j;
    }
  }
}
vector<int> per;
bool bye[1010], inq[1010];
inline void cal() {
  for (int i = 0; i < n; i++) {
    vector<int> target;
    int ptr = 0;
    target.push_back(i);
    inq[i] = true;
    for (int j = 0; j < k && ptr < (int)target.size(); j++) {
      if (k - j < (int)target.size() - ptr) break;
      int tar = target[ptr++], now = per[j];
      for (int u = st[now][tar]; u < pos[now][tar]; u++) {
        int tmp = v[now][u].second;
        if (inq[tmp]) continue;
        inq[tmp] = true;
        target.push_back(tmp);
        if ((int)target.size() - ptr > k - j - 1) break;
      }
    }
    if (ptr == (int)target.size()) bye[i] = true;
    for (int tmp : target) inq[tmp] = false;
  }
}
void solve() {
  for (int i = 0; i < k; i++) per.push_back(i);
  do cal();
  while (next_permutation((per).begin(), (per).end()));
  int ans = 0;
  for (int i = 0; i < n; i++)
    if (bye[i]) ans++;
  printf("%d\n", ans);
}
int main() {
  build();
  while (__--) {
    init();
    solve();
  }
}
