#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, x, res = 0;
  set<long long> s;
  cin >> n >> x;
  for (long long i = 0; i < n; ++i) {
    cin >> k;
    s.insert(k);
  }
  for (set<long long>::iterator it = s.begin(); it != s.end(); ++it) {
    set<long long>::iterator z = s.find(*it * x);
    if (z != s.end() && z != it) {
      s.erase(z);
    }
    ++res;
  }
  cout << res;
  return 0;
}
