#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
long long fact(int n) {
  if (n == 0 || n == 1) return 1;
  long long res = 1;
  for (int i = 2; i <= n; i++) res *= i;
  return res;
}
long long comb(long long n, long long k) {
  if (n == k) return 1;
  return ((n * comb(n - 1, k)) / (n - k));
}
bool isPrime(int n) {
  if (n < 2) return false;
  if (n == 2) return true;
  for (int i = 2; i <= sqrt(n); i++)
    if (n % i == 0) return false;
  return true;
}
long long power(long long a, long long k) {
  if (k == 0) return 1;
  if (k == 1) return a;
  long long tmp = power(a, k >> 1);
  tmp = (tmp * tmp) % MOD;
  return k % 2 ? (tmp * a) % MOD : tmp;
}
string int_to_string(int n) {
  string res = "";
  while (n / 10 > 0) {
    res += n % 10 + '0';
    n /= 10;
  }
  res += n % 10 + '0';
  string ans = "";
  for (int i = res.size() - 1; i >= 0; i--) ans += res[i];
  return ans;
}
long long string_to_int(string s) {
  long long res = 0;
  for (int i = 0; i < s.size(); i++)
    res += (s[i] - '0') * power(10, s.size() - 1 - i);
  return res;
}
int get_gcd(int a, int b) {
  if (b == 0) return a;
  return get_gcd(b, a % b);
}
vector<int> common_divisors(int a, int b) {
  int tmp = get_gcd(a, b);
  vector<int> res;
  for (int i = 1; i <= sqrt(tmp); i++)
    if (tmp % i == 0) {
      if (i * i == tmp)
        res.push_back(i);
      else {
        res.push_back(i);
        res.push_back(tmp / i);
      }
    }
  return res;
}
void Anivia_kid() {
  long long n, k;
  cin >> n >> k;
  set<int> s;
  if (k == 1) {
    cout << n << endl;
    return;
  }
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < n; i++) {
    if (v[i] % k != 0)
      s.insert(v[i]);
    else {
      if (s.find(v[i] / k) == s.end()) s.insert(v[i]);
    }
  }
  cout << s.size() << endl;
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  int q = 1;
  while (q--) {
    Anivia_kid();
  }
  return 0;
}

### Prompt

Generate a cpp solution to 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 int MOD = 1e9 + 7;
long long fact(int n) {
  if (n == 0 || n == 1) return 1;
  long long res = 1;
  for (int i = 2; i <= n; i++) res *= i;
  return res;
}
long long comb(long long n, long long k) {
  if (n == k) return 1;
  return ((n * comb(n - 1, k)) / (n - k));
}
bool isPrime(int n) {
  if (n < 2) return false;
  if (n == 2) return true;
  for (int i = 2; i <= sqrt(n); i++)
    if (n % i == 0) return false;
  return true;
}
long long power(long long a, long long k) {
  if (k == 0) return 1;
  if (k == 1) return a;
  long long tmp = power(a, k >> 1);
  tmp = (tmp * tmp) % MOD;
  return k % 2 ? (tmp * a) % MOD : tmp;
}
string int_to_string(int n) {
  string res = "";
  while (n / 10 > 0) {
    res += n % 10 + '0';
    n /= 10;
  }
  res += n % 10 + '0';
  string ans = "";
  for (int i = res.size() - 1; i >= 0; i--) ans += res[i];
  return ans;
}
long long string_to_int(string s) {
  long long res = 0;
  for (int i = 0; i < s.size(); i++)
    res += (s[i] - '0') * power(10, s.size() - 1 - i);
  return res;
}
int get_gcd(int a, int b) {
  if (b == 0) return a;
  return get_gcd(b, a % b);
}
vector<int> common_divisors(int a, int b) {
  int tmp = get_gcd(a, b);
  vector<int> res;
  for (int i = 1; i <= sqrt(tmp); i++)
    if (tmp % i == 0) {
      if (i * i == tmp)
        res.push_back(i);
      else {
        res.push_back(i);
        res.push_back(tmp / i);
      }
    }
  return res;
}
void Anivia_kid() {
  long long n, k;
  cin >> n >> k;
  set<int> s;
  if (k == 1) {
    cout << n << endl;
    return;
  }
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < n; i++) {
    if (v[i] % k != 0)
      s.insert(v[i]);
    else {
      if (s.find(v[i] / k) == s.end()) s.insert(v[i]);
    }
  }
  cout << s.size() << endl;
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  int q = 1;
  while (q--) {
    Anivia_kid();
  }
  return 0;
}

```