#include <bits/stdc++.h>
using namespace std;
int v[100009];
map<double, bool> mb;
int main() {
  long long n, k, i, j, l, cnt = 0;
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v, v + n);
  for (i = 0; i < n; i++) {
    double val = (double)(v[i] / (double)k);
    if (!mb[val]) {
      cnt++;
      mb[v[i]] = true;
    }
  }
  cout << cnt << endl;
  return 0;
}
