#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int ax[N], ay[N], bx[N], by[N];
vector<int> v, vec[N][10];
int n, k;
int used[N], cnt[N];
bool chk(int a, int b, int c, int d) {
  if ((long long)a * d != (long long)b * c) return 0;
  if ((long long)a * c < 0 || (long long)b * d < 0) return 0;
  if (abs(a) < abs(c) || abs(b) < abs(d)) return 0;
  return 1;
}
int flag;
void dfs(int les) {
  if (v.empty()) flag = 1;
  if (flag) return;
  if ((int)v.size() > les) return;
  vector<int> vv = v;
  random_shuffle(v.begin(), v.end());
  int u = v.back();
  v.pop_back();
  int w = cnt[u];
  cnt[u] = 0;
  for (int i = 1; i <= k; ++i)
    if (!used[i] && vec[u][i].size() < les) {
      used[i] = 1;
      for (int j : vec[u][i]) {
        if (!cnt[j]) v.push_back(j);
        ++cnt[j];
      }
      dfs(les - 1);
      used[i] = 0;
      for (int j : vec[u][i]) --cnt[j];
      while (!v.empty() && !cnt[v.back()]) v.pop_back();
    }
  cnt[u] = w;
  v = vv;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> k >> n;
  for (int i = 1; i <= k; ++i) cin >> ax[i] >> ay[i];
  for (int i = 1; i <= n; ++i) cin >> bx[i] >> by[i];
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= k; ++j)
      for (int l = 1; l <= n; ++l)
        if (l != i)
          if (chk(bx[i] - ax[j], by[i] - ay[j], bx[l] - ax[j], by[l] - ay[j]))
            vec[i][j].push_back(l);
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    cnt[i]++;
    flag = 0;
    v.clear();
    v.push_back(i);
    for (int ti = 0; ti < 100; ++ti) dfs(k);
    cnt[i]--;
    ans += flag;
  }
  cout << ans << '\n';
  return 0;
}
