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 int mxn = 1e5 + 5;
vector<long long> primes;
long long cc_size;
int vis[100001];
void sieve() {
  for (int i = 2; i < mxn; i++) {
    if (vis[i]) continue;
    primes.push_back(i);
    for (int j = i + i; j < mxn; j += i) {
      vis[j] = 1;
    }
  }
}
vector<int> adj[100001];
int cost[100001];
void dfs(int u) {
  vis[u] = 1;
  for (auto v : adj[u]) {
    if (vis[v]) continue;
    dfs(v);
  }
}
bool is_prime(int x) {
  if (x == 1) return false;
  for (int i = 2; i * i <= x; i++) {
    if (x % i == 0) return false;
  }
  return true;
}
int log(int n, int k) {
  int ans = 0;
  while (n > 0) {
    n /= k;
    ans++;
  }
  return ans;
}
bool cmp1(pair<long, long> x, pair<long, long> y) {
  if (x.first != y.first) return x.first < y.first;
  return x.second > y.second;
}
long long sm(long long n) {
  long long sum = 0;
  while (n != 0) {
    long long nd = n % 10;
    sum += nd;
    n /= 10;
  }
  return sum;
}
int track[100005];
int main() {
  long long n, k;
  cin >> n >> k;
  vector<long long> v(n + 1);
  for (long long i = 1; i <= n; i++) {
    cin >> v[i];
  }
  sort(begin(v), end(v));
  map<long long, long long> make_pair;
  for (long long i = 1; i <= n; i++) {
    make_pair[v[i]] = i;
  }
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    if (!track[i]) {
      track[make_pair[v[i] * k]] = 1;
      ans++;
    }
  }
  cout << ans << '\n';
  return 0;
}
