Bearland is a dangerous place. Limak can’t travel on foot. Instead, he has k magic teleportation stones. Each stone can be used at most once. The i-th stone allows to teleport to a point (axi, ayi). Limak can use stones in any order.

There are n monsters in Bearland. The i-th of them stands at (mxi, myi).

The given k + n points are pairwise distinct.

After each teleportation, Limak can shoot an arrow in some direction. An arrow will hit the first monster in the chosen direction. Then, both an arrow and a monster disappear. It’s dangerous to stay in one place for long, so Limak can shoot only one arrow from one place.

A monster should be afraid if it’s possible that Limak will hit it. How many monsters should be afraid of Limak?

Input

The first line of the input contains two integers k and n (1 ≤ k ≤ 7, 1 ≤ n ≤ 1000) — the number of stones and the number of monsters.

The i-th of following k lines contains two integers axi and ayi ( - 109 ≤ axi, ayi ≤ 109) — coordinates to which Limak can teleport using the i-th stone.

The i-th of last n lines contains two integers mxi and myi ( - 109 ≤ mxi, myi ≤ 109) — coordinates of the i-th monster.

The given k + n points are pairwise distinct.

Output

Print the number of monsters which should be afraid of Limak.

Examples

Input

2 4
-2 -1
4 5
4 2
2 1
4 -1
1 -1


Output

3


Input

3 8
10 20
0 0
20 40
300 600
30 60
170 340
50 100
28 56
90 180
-4 -8
-1 -2


Output

5

Note

In the first sample, there are two stones and four monsters. Stones allow to teleport to points ( - 2, - 1) and (4, 5), marked blue in the drawing below. Monsters are at (4, 2), (2, 1), (4, - 1) and (1, - 1), marked red. A monster at (4, - 1) shouldn't be afraid because it's impossible that Limak will hit it with an arrow. Other three monsters can be hit and thus the answer is 3.

<image>

In the second sample, five monsters should be afraid. Safe monsters are those at (300, 600), (170, 340) and (90, 180).
#include <bits/stdc++.h>
using namespace std;
template <typename tp>
inline void read(tp& x) {
  x = 0;
  char tmp;
  bool key = 0;
  for (tmp = getchar(); !isdigit(tmp); tmp = getchar()) key = (tmp == '-');
  for (; isdigit(tmp); tmp = getchar()) x = (x << 3) + (x << 1) + (tmp ^ '0');
  if (key) x = -x;
}
template <typename tp>
inline void ckmn(tp& x, tp y) {
  x = x < y ? x : y;
}
template <typename tp>
inline void ckmx(tp& x, tp y) {
  x = x < y ? y : x;
}
struct point {
  int x, y;
  point(int x = 0, int y = 0) : x(x), y(y) {}
  point operator+(const point& a) const { return point(x + a.x, y + a.y); }
  point operator-(const point& a) const { return point(x - a.x, y - a.y); }
};
long long cross(point a, point b) { return 1ll * a.x * b.y - 1ll * a.y * b.x; }
long long dot(point a, point b) { return 1ll * a.x * b.x + 1ll * a.y * b.y; }
const int N = 1010, K = 10;
int n, k, ans, per[K], tmp, vis[N], rec;
point p1[N], p2[N];
vector<int> pat[K][N];
bool dfs(int cur) {
  if (tmp >= k) return false;
  int x = per[++tmp];
  for (int i = (0); i <= ((int)pat[x][cur].size() - 1); ++i) {
    if (vis[pat[x][cur][i]] != rec) {
      if (!dfs(pat[x][cur][i])) return false;
    }
  }
  vis[cur] = rec;
  return true;
}
int main() {
  read(k), read(n);
  for (int i = (1); i <= (k); ++i) read(p1[i].x), read(p1[i].y);
  for (int i = (1); i <= (n); ++i) read(p2[i].x), read(p2[i].y);
  for (int i = (1); i <= (k); ++i)
    for (int a = (1); a <= (n); ++a)
      for (int b = (1); b <= (n); ++b)
        if (cross(p2[b] - p1[i], p2[a] - p1[i]) == 0) {
          if (dot(p1[i] - p2[b], p2[a] - p2[b]) < 0) pat[i][a].push_back(b);
        }
  for (int i = (1); i <= (n); ++i) {
    int key = 0;
    for (int j = (1); j <= (k); ++j) per[j] = j;
    do {
      tmp = 0;
      ++rec;
      if (dfs(i)) {
        key = 1;
        break;
      }
    } while (next_permutation(per + 1, per + k + 1));
    ans += key;
  }
  cout << ans << endl;
  return 0;
}
