#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void ckmax(T& x, T y) {
  x = (y > x ? y : x);
}
template <typename T>
inline void ckmin(T& x, T y) {
  x = (y < x ? y : x);
}
const int MAXN = 1000;
const int MAXK = 7;
struct Point {
  long long x, y;
  Point(long long _x = 0, long long _y = 0) {
    x = _x;
    y = _y;
  }
};
struct Vector {
  long long x, y;
  Vector(long long _x = 0, long long _y = 0) {
    x = _x;
    y = _y;
  }
};
Vector operator-(Point p1, Point p2) {
  return Vector(p1.x - p2.x, p1.y - p2.y);
}
long long dot(Vector v1, Vector v2) { return v1.x * v2.x + v1.y * v2.y; }
long long cross(Vector v1, Vector v2) { return v1.x * v2.y - v1.y * v2.x; }
bool on_segment(Point s1, Point s2, Point p) {
  return cross((s1 - p), (s2 - p)) == 0 && dot((s1 - p), (s2 - p)) < 0;
}
int K, n;
Point ak[MAXK + 5], an[MAXN + 5];
vector<int> obs[MAXK + 5][MAXN + 5];
int rest_s;
bool used_s[MAXK + 5], used_t[MAXN + 5];
bool check(int s, int t);
bool dfs(int idx, vector<int>& ss, const vector<int>& tt) {
  assert(((int)(ss).size()) == idx);
  if (idx == ((int)(tt).size())) {
    for (int i = 0; i < ((int)(tt).size()); ++i) {
      if (!check(ss[i], tt[i])) {
        return false;
      }
    }
    return true;
  }
  for (int i = 1; i <= K; ++i) {
    if (!used_s[i]) {
      ss.push_back(i);
      used_s[i] = 1;
      bool res = dfs(idx + 1, ss, tt);
      ss.pop_back();
      used_s[i] = 0;
      if (res) return true;
    }
  }
  return false;
}
bool check(int s, int t) {
  vector<int> tt;
  for (int i = 0; i < ((int)(obs[s][t]).size()); ++i) {
    int _t = obs[s][t][i];
    if (!used_t[_t]) {
      if (rest_s == 0) {
        for (int j = 0; j < ((int)(tt).size()); ++j) {
          used_t[tt[j]] = 0;
        }
        rest_s += ((int)(tt).size());
        return false;
      }
      used_t[_t] = 1;
      rest_s--;
      tt.push_back(_t);
    }
  }
  vector<int> ss;
  bool res = dfs(0, ss, tt);
  for (int i = 0; i < ((int)(tt).size()); ++i) {
    used_t[tt[i]] = 0;
  }
  rest_s += ((int)(tt).size());
  return res;
}
int main() {
  cin >> K >> n;
  for (int i = 1; i <= K; ++i) {
    cin >> ak[i].x >> ak[i].y;
  }
  for (int i = 1; i <= n; ++i) {
    cin >> an[i].x >> an[i].y;
  }
  for (int i = 1; i <= K; ++i) {
    for (int j = 1; j <= n; ++j) {
      for (int k = 1; k <= n; ++k) {
        if (j == k) continue;
        if (on_segment(ak[i], an[j], an[k])) {
          obs[i][j].push_back(k);
        }
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= K; ++j) {
      used_s[j] = 1;
      used_t[i] = 1;
      rest_s = K - 1;
      bool res = check(j, i);
      used_s[j] = 0;
      used_t[i] = 0;
      rest_s = K;
      if (res) {
        ans++;
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
