#include <bits/stdc++.h>
using namespace std;
const long long linf = 1e18 + 9;
const int inf = 1e9 + 9;
const int N = 1e5 + 9;
pair<long long, long long> arr[N];
long long n, k, size;
long long bs(long long temp, long long i) {
  long long bas = 0;
  long long son = n;
  long long res = 0;
  while (bas + 1 < son) {
    long long orta = bas + son >> 1;
    if (arr[orta].first > temp * k)
      son = orta;
    else {
      if (arr[orta].first == temp * k) {
        arr[orta].second = 1;
        long long prev = 0;
        for (long long j = i; j < orta; j++) {
          if (arr[j].second >= 1)
            prev++;
          else
            arr[j].second = inf;
        }
        return orta - i - prev;
      }
      bas = orta;
    }
  }
  return arr[i].second == 0;
}
int main() {
  scanf("%lld %lld", &n, &k);
  if (k == 1) {
    printf("%lld", n), puts("");
    return 0;
  }
  for (long long i = 0; i < n; i++) scanf("%lld", &arr[i].first);
  sort(arr, arr + n);
  for (long long i = 0; i < n; i++) {
    if (arr[i].second == 1) continue;
    size += bs(arr[i].first, i);
  }
  printf("%lld", size), puts("");
  return 0;
}

### Prompt

In Cpp, your task is to solve the following problem:

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}.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const long long linf = 1e18 + 9;
const int inf = 1e9 + 9;
const int N = 1e5 + 9;
pair<long long, long long> arr[N];
long long n, k, size;
long long bs(long long temp, long long i) {
  long long bas = 0;
  long long son = n;
  long long res = 0;
  while (bas + 1 < son) {
    long long orta = bas + son >> 1;
    if (arr[orta].first > temp * k)
      son = orta;
    else {
      if (arr[orta].first == temp * k) {
        arr[orta].second = 1;
        long long prev = 0;
        for (long long j = i; j < orta; j++) {
          if (arr[j].second >= 1)
            prev++;
          else
            arr[j].second = inf;
        }
        return orta - i - prev;
      }
      bas = orta;
    }
  }
  return arr[i].second == 0;
}
int main() {
  scanf("%lld %lld", &n, &k);
  if (k == 1) {
    printf("%lld", n), puts("");
    return 0;
  }
  for (long long i = 0; i < n; i++) scanf("%lld", &arr[i].first);
  sort(arr, arr + n);
  for (long long i = 0; i < n; i++) {
    if (arr[i].second == 1) continue;
    size += bs(arr[i].first, i);
  }
  printf("%lld", size), puts("");
  return 0;
}

```