#include <bits/stdc++.h>
using namespace std;
const int iinf = 1e9 + 7;
const long long linf = 1ll << 60;
const double dinf = 1e10;
template <typename T>
inline void scf(T &x) {
  bool f = 0;
  x = 0;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') {
    f = 1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  if (f) x = -x;
  return;
}
template <typename T1, typename T2>
void scf(T1 &x, T2 &y) {
  scf(x);
  return scf(y);
}
template <typename T1, typename T2, typename T3>
void scf(T1 &x, T2 &y, T3 &z) {
  scf(x);
  scf(y);
  return scf(z);
}
const int N = 1010;
int k, n, ans, MASK;
pair<int, int> tele[10], mons[N];
vector<int> otw[10][N];
int LOW[N], LOG[N], MSK[10], CNT[N];
bool killed[N];
inline int ABS(const int &x) { return x < 0 ? -x : x; }
inline int lowbit(const int &x) { return x & (-x); }
inline bool dfs(int avail, vector<int> to_kill) {
  int sz = (int)to_kill.size();
  if (!sz) return 1;
  if (sz > CNT[avail]) return 0;
  int _ = avail;
  vector<int> tmp;
  while (_) {
    int mask = LOW[_], i = LOG[mask];
    _ ^= mask;
    for (auto j : to_kill)
      if ((int)otw[i][j].size() <= k) {
        tmp.clear();
        killed[j] = 1;
        for (auto x : to_kill)
          if (!killed[x]) tmp.push_back(x);
        for (auto x : otw[i][j])
          if (!killed[x]) tmp.push_back(x);
        sort(tmp.begin(), tmp.end());
        tmp.erase(unique(tmp.begin(), tmp.end()), tmp.end());
        if (dfs(avail ^ mask, tmp)) return 1;
        killed[j] = 0;
      }
  }
  return 0;
}
inline bool covered(const pair<int, int> &dir2, const pair<int, int> &dir) {
  bool f1, f2;
  if (dir.first >= 0)
    f1 = (dir2.first >= 0 && dir2.first <= dir.first);
  else
    f1 = (dir2.first <= 0 && dir2.first >= dir.first);
  if (dir.second >= 0)
    f2 = (dir2.second >= 0 && dir2.second <= dir.second);
  else
    f2 = (dir2.second <= 0 && dir2.second >= dir.second);
  return f1 && f2;
}
int main() {
  scf(k, n);
  MASK = (1 << k) - 1;
  for (int i = (0); i <= (MASK); i++) LOW[i] = lowbit(i);
  for (int i = 0; i < (k); i++) LOG[1 << i] = i, MSK[i] = 1 << i;
  for (int i = (0); i <= (MASK); i++) {
    int t = i;
    while (t) CNT[i]++, t ^= LOW[t];
  }
  for (int i = 0; i < (k); i++) {
    int x, y;
    scf(x, y);
    tele[i] = make_pair(x, y);
  }
  for (int i = 0; i < (n); i++) {
    int x, y;
    scf(x, y);
    mons[i] = make_pair(x, y);
  }
  for (int i = 0; i < (k); i++)
    for (int j = 0; j < (n); j++) {
      pair<int, int> dir = make_pair(mons[j].first - tele[i].first,
                                     mons[j].second - tele[i].second);
      for (int j2 = 0; j2 < (n); j2++)
        if (j2 != j) {
          pair<int, int> dir2 = make_pair(mons[j2].first - tele[i].first,
                                          mons[j2].second - tele[i].second);
          if (covered(dir2, dir)) {
            if (1ll * dir.first * dir2.second ==
                1ll * dir.second * dir2.first) {
              otw[i][j].push_back(j2);
              if ((int)otw[i][j].size() > k) break;
            }
          }
        }
    }
  for (int i = 0; i < (n); i++) {
    memset(killed, 0, sizeof(killed));
    if (dfs(MASK, vector<int>{i})) ans++;
  }
  printf("%d\n", ans);
  return 0;
}
