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;
const long long maxn = 1e5 + 5;
void c_p_c() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i += 6) {
    if (n % i == 0 || n % (i + 2) == 0) return false;
  }
  return true;
}
set<long long> Sieve(long long n) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (long long i = 2; i * i <= n; i++) {
    if (prime[i]) {
      for (long long j = i * i; j <= n; j += i) {
        prime[j] = false;
      }
    }
  }
  set<long long> primes;
  for (long long i = 2; i <= n; i++) {
    if (prime[i]) primes.insert(i);
  }
  return primes;
}
set<long long> primeFactors(long long n) {
  set<long long> factors;
  while (n % 2 == 0) {
    n /= 2;
    factors.insert(2);
  }
  for (long long i = 3; i <= sqrt(n); i += 2) {
    while (n % i == 0) {
      factors.insert(i);
      n /= i;
    }
  }
  if (n > 2) factors.insert(n);
  return factors;
}
long long power(long long x, unsigned long long y, long long p) {
  long long res = 1;
  x = x % p;
  if (x == 0) return 0;
  ;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool isPower(long long x, long long y) {
  if (x == 1) return (y == 1);
  unsigned long long a = 1;
  while (a < y) a *= x;
  return (a == y);
}
set<long long> getDivisor(long long n) {
  set<long long> ans;
  ans.insert(1);
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      ans.insert(i);
      ans.insert(n / i);
    }
  }
  ans.insert(n);
  return ans;
}
int32_t main() {
  c_p_c();
  long long n, k;
  cin >> n >> k;
  vector<long long> v(n);
  map<long long, long long> occ;
  if (n == 1) {
    long long x;
    cin >> x;
    cout << 1 << '\n';
  } else if (k == 1) {
    for (long long i = 0; i < n; i++) {
      cin >> v[i];
      occ[v[i]]++;
    }
    cout << n << '\n';
  } else {
    for (long long i = 0; i < n; i++) {
      cin >> v[i];
      occ[v[i]]++;
    }
    sort(v.begin(), v.end(), greater<long long>());
    long long ans = n;
    for (long long i = 0; i < n; i++) {
      if (v[i] % k == 0 && occ[v[i] / k] > 0 && occ[v[i]] > 0) {
        ans--;
        occ[v[i] / k]--;
      }
    }
    cout << ans << '\n';
  }
}
