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 int MOD = 1000000000 + 7;
const long long int MOD1 = 998244353;
const long long int Val9 = 1000000000;
const long long int Val6 = 1000000;
vector<long long int> vd;
map<long long int, long long int> diff;
long long int no_of_divisors(long long int n) {
  long long int c = 0;
  for (long long int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i) {
        c++;
        vd.push_back(i);
      } else {
        c += 2;
        vd.push_back(i);
        vd.push_back(n / i);
      }
    }
  }
  long long int m = 1000000;
  sort(vd.begin(), vd.end());
  for (long long int i = (long long int)1; i < (long long int)vd.size(); i++) {
    long long int p = vd[i] - vd[i - 1];
    if (p < m) m = p;
  }
  diff[n] = m;
  vd.clear();
  return c;
}
long long int pwr(long long int x, long long int y) {
  long long int r = 1;
  while (y > 0) {
    if (y & 1) r = r * x;
    x *= x;
    y >>= 1;
  }
  return r;
}
long long int pwrm(long long int x, long long int y, long long int m) {
  x %= m;
  long long int r = 1;
  while (y > 0) {
    if (y & 1) r = r * x % m;
    x = x * x % m;
    y >>= 1;
  }
  return r;
}
int isPrime(long long int n) {
  if (n <= 1) return 0;
  if (n <= 3) return 1;
  if (n % 2 == 0 || n % 3 == 0) return 0;
  for (long long int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return 0;
  return 1;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
vector<long long int> vprime;
vector<long long int> vsqr;
void SieveOfEratosthenes(long long int n) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (long long int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (long long int p = 2; p <= n; p++) {
    if (prime[p]) {
      vprime.push_back(p);
      vsqr.push_back(p * p);
    }
  }
}
bool vis[Val6 + 5] = {false};
long long int ans = -1;
vector<long long int> v[Val6];
vector<long long int> ans1;
long long int dp[Val6] = {0};
long long int dfs(long long int s) {
  long long int m = s;
  long long int p = v[s].size();
  ans1.push_back(s);
  vis[s] = true;
  long long int c = 0;
  for (long long int i = 0; i < v[s].size(); i += 2) {
    if (vis[v[s][i]] == false) {
      c++;
      dp[v[s][i]] = v[s][i + 1] + dp[m];
      dfs(v[s][i]);
    }
  }
  return 0;
}
vector<pair<long long int, pair<long long int, long long int>>> color;
map<long long int, long long int> parent;
void bfs(long long int n) {
  queue<long long int> q;
  q.push(n);
  parent[n] = 0;
  vis[n] = true;
  long long int dist = 0;
  while (!q.empty()) {
    long long int p = q.front();
    q.pop();
    dist++;
    for (long long int i = (long long int)0; i < (long long int)v[p].size();
         i++) {
      if (vis[v[p][i]] == false) {
        parent[v[p][i]] = p;
        q.push(v[p][i]);
        vis[v[p][i]] = true;
      }
    }
  }
}
long long int nCr(long long int n, long long int r) {
  long long int ans = 1;
  for (long long int i = (long long int)0; i < (long long int)r; i++) {
    ans *= n - i;
    ans /= i + 1;
  }
  return ans;
}
long long int dis[100005];
long long int par[100005];
vector<pair<long long int, long long int>> vp[100005];
long long int dij(long long int n, long long int a, long long int e) {
  for (long long int i = (long long int)0; i < (long long int)n + 1; i++)
    vis[i] = false;
  for (long long int i = (long long int)1; i < (long long int)n + 1; i++) {
    dis[i] = 100000000000000000;
  }
  dis[a] = 0;
  par[a] = 0;
  priority_queue<pair<long long int, long long int>> q;
  q.push({0, a});
  long long int ans = 0;
  while (!q.empty()) {
    long long int x = q.top().second;
    q.pop();
    if (vis[x]) continue;
    vis[x] = true;
    for (auto it : vp[x]) {
      long long int b = it.first;
      long long int w = it.second;
      if (dis[x] + w < dis[b]) {
        dis[b] = dis[x] + w;
        q.push({-dis[b], b});
        par[b] = x;
      }
    }
  }
  return ans;
}
vector<pair<long long int, pair<long long int, long long int>>> p;
long long int find_set(long long int v) {
  if (v == parent[v]) return v;
  return parent[v] = find_set(parent[v]);
}
long long int kruskal(long long int m) {
  long long int minw = 0;
  for (long long int i = (long long int)0; i < (long long int)m; i++) {
    long long int x = find_set(p[i].second.first);
    long long int y = find_set(p[i].second.second);
    long long int w = p[i].first;
    if (x != y) {
      minw += w;
      parent[y] = x;
    }
  }
  return minw;
}
long long int n, m;
long long int isvalid(long long int x, long long int y) {
  if (x >= 0 && x < n && y >= 0 && y < m)
    return 1;
  else {
    return 0;
  }
}
long long int visited[255][255];
long long int ad[255][255];
long long int dx[4] = {-1, 0, 1, 0};
long long int dy[4] = {0, 1, 0, -1};
long long int bfsg(long long int x, long long int y) {
  queue<pair<long long int, long long int>> q;
  long long int ans = 0;
  q.push({x, y});
  visited[x][y] = 1;
  while (!q.empty()) {
    long long int x1 = q.front().first;
    long long int y1 = q.front().second;
    q.pop();
    if (ad[x1][y1] == 1) {
      for (long long int i = (long long int)0; i < (long long int)4; i++) {
        if (isvalid(x1 + dx[i], y1 + dy[i]) &&
            visited[x1 + dx[i]][y1 + dy[i]] == 0) {
          long long int newx = x1 + dx[i];
          long long int newy = y1 + dy[i];
          visited[newx][newy] = 1;
          q.push({newx, newy});
        }
      }
      ans++;
    }
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  {
    long long int n, k;
    cin >> n >> k;
    long long int a[n];
    for (long long int i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    if (k == 1)
      cout << n;
    else {
      map<long long int, long long int> m;
      long long int ans = 0;
      for (long long int i = (long long int)0; i < (long long int)n; i++) {
        long long int x = a[i];
        long long int p = a[i] * k;
        long long int l = i, h = n - 1;
        if (m[x] != -1) {
          while (l <= h) {
            long long int mid = (l + h) / 2;
            if (a[mid] == p) {
              m[a[mid]] = -1;
              break;
            } else if (a[mid] > p)
              h = mid - 1;
            else {
              l = mid + 1;
            }
          }
          ans++;
        }
      }
      cout << ans;
    }
  }
  cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
       << "ms\n";
  return 0;
}
