A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (x < y) from the set, such that y = x·k.

You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-multiple free subset.

Input

The first line of the input contains two integers n and k (1 ≤ n ≤ 105, 1 ≤ k ≤ 109). The next line contains a list of n distinct positive integers a1, a2, ..., an (1 ≤ ai ≤ 109).

All the numbers in the lines are separated by single spaces.

Output

On the only line of the output print the size of the largest k-multiple free subset of {a1, a2, ..., an}.

Examples

Input

6 2
2 3 6 5 4 10


Output

3

Note

In the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}.
#include <bits/stdc++.h>
using namespace std;
int comp(const void* x, const void* y) { return *(int*)x - *(int*)y; }
int a[100007];
int bad[100007];
bool used[100007];
int main() {
  int i;
  int n, k;
  cin >> n >> k;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) used[i] = false;
  if (k == 1) {
    cout << n;
    return 0;
  }
  qsort(a, n, sizeof(int), comp);
  int p1, p2 = 0;
  int kf = 0;
  for (p1 = 0; p1 < n; p1++) {
    while (p2 != n && (long long)a[p2] < (long long)a[p1] * (long long)k) p2++;
    bad[p1] = -1;
    if (p2 != n && (long long)a[p2] == (long long)k * (long long)a[p1])
      bad[p1] = p2;
  }
  int toDel = 0;
  for (i = 0; i < n; i++)
    if (!used[i]) {
      int cc = 1;
      int j = i;
      used[i] = true;
      while (bad[j] != -1) {
        j = bad[j];
        cc++;
        used[j] = true;
      }
      toDel += cc / 2;
    }
  cout << n - toDel;
}
