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 T, typename U>
inline void smin(T &a, const U &b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, const U &b) {
  if (a < b) a = b;
}
template <class T>
inline void gn(T &first) {
  char c, sg = 0;
  while (c = getchar(), (c > '9' || c < '0') && c != '-')
    ;
  for ((c == '-' ? sg = 1, c = getchar() : 0), first = 0; c >= '0' && c <= '9';
       c = getchar())
    first = (first << 1) + (first << 3) + c - '0';
  if (sg) first = -first;
}
template <class T1, class T2>
inline void gn(T1 &x1, T2 &x2) {
  gn(x1), gn(x2);
}
template <class T1, class T2, class T3>
inline void gn(T1 &x1, T2 &x2, T3 &x3) {
  gn(x1, x2), gn(x3);
}
template <class T1, class T2, class T3, class T4>
inline void gn(T1 &x1, T2 &x2, T3 &x3, T4 &x4) {
  gn(x1, x2, x3), gn(x4);
}
template <class T1, class T2, class T3, class T4, class T5>
inline void gn(T1 &x1, T2 &x2, T3 &x3, T4 &x4, T5 &x5) {
  gn(x1, x2, x3, x4), gn(x5);
}
template <class T>
inline void print(T first) {
  if (first < 0) {
    putchar('-');
    return print(-first);
  }
  if (first < 10) {
    putchar('0' + first);
    return;
  }
  print(first / 10);
  putchar(first % 10 + '0');
}
template <class T>
inline void println(T first) {
  print(first);
  putchar('\n');
}
template <class T>
inline void printsp(T first) {
  print(first);
  putchar(' ');
}
template <class T1, class T2>
inline void print(T1 x1, T2 x2) {
  printsp(x1), println(x2);
}
template <class T1, class T2, class T3>
inline void print(T1 x1, T2 x2, T3 x3) {
  printsp(x1), printsp(x2), println(x3);
}
template <class T1, class T2, class T3, class T4>
inline void print(T1 x1, T2 x2, T3 x3, T4 x4) {
  printsp(x1), printsp(x2), printsp(x3), println(x4);
}
template <class T1, class T2, class T3, class T4, class T5>
inline void print(T1 x1, T2 x2, T3 x3, T4 x4, T5 x5) {
  printsp(x1), printsp(x2), printsp(x3), printsp(x4), println(x5);
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
struct point {
  int first, second;
  point(int first = 0, int second = 0) : first(first), second(second) {}
  point operator-(point a) { return point(first - a.first, second - a.second); }
  point operator+(point a) { return point(first + a.first, second + a.second); }
  point operator*(int a) { return point(first * a, second * a); }
  point operator/(int a) { return point(first / a, second / a); }
  point operator&(point a) {
    return point(first * a.first - second * a.second,
                 first * a.second + second * a.first);
  }
  point rotate(double al) { return *this & point(cos(al), sin(al)); }
  long long operator^(point a) {
    return 1LL * first * a.second - 1LL * second * a.first;
  }
  long long operator*(point a) {
    return 1LL * first * a.first + 1LL * second * a.second;
  }
  point conj() { return point(-second, first); }
  double nor() { return sqrt(*this * *this); }
  long long nor2() { return *this * *this; }
  double al() { return atan2(second, first); }
  bool operator<(const point &a) const {
    if (first != a.first) return first < a.first;
    return second < a.second;
  }
  bool operator>(const point &a) const {
    if (first != a.first) return first > a.first;
    return second > a.second;
  }
  bool operator==(const point &a) const {
    return (first == a.first && second == a.second);
  }
  bool operator!=(const point &a) const {
    return (first != a.first || second != a.second);
  }
  void input() { gn(first, second); }
  void print() { printf("%d %d\n", first, second); }
};
int sgn(long long a) { return (a > 0) - (a < 0); }
bool is_on(point a, point b, point c) {
  if (sgn(a - b ^ b - c)) return 0;
  return sgn((a - c) * (b - c)) <= 0;
}
point s[1111], p[1111];
vector<int> id[10][1111];
int f[10], n;
int st[1111], vst[1111];
int runs;
bool dan(int first) {
  for (int i = 1; i <= n; i++) f[i] = i;
  do {
    int nn = 0, tar = first;
    runs++;
    vst[first] = runs;
    for (int i = 1; i <= n; i++) {
      for (int j = id[f[i]][tar].size(); j--;) {
        int u = id[f[i]][tar][j];
        if (vst[u] != runs) st[nn++] = u;
        vst[u] = runs;
      }
      if (nn > n - i) break;
      if (nn == 0) return true;
      if (i == n) break;
      nn--;
      tar = st[nn];
      vst[tar] = runs;
    }
    if (!nn) return true;
  } while (next_permutation(f + 1, f + n + 1));
  return false;
}
int main() {
  int m;
  gn(n, m);
  for (int i = 1; i <= n; i++) s[i].input();
  for (int i = 1; i <= m; i++) p[i].input();
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      for (int k = 1; k <= m; k++)
        if (k != j && is_on(s[i], p[j], p[k])) {
          id[i][j].push_back(k);
          if (id[i][j].size() > n) break;
        }
    }
  }
  int ans = 0;
  for (int i = 1; i <= m; i++)
    if (dan(i)) {
      ans++;
    }
  println(ans);
}
