#include <bits/stdc++.h>
using namespace std;
int main() {
  long int quant, mul;
  scanf("%ld %ld", &quant, &mul);
  long int *nums = (long int *)calloc(quant, sizeof(long int));
  set<long int> s;
  for (long int i = 0; i < quant; i++) {
    scanf("%ld", &nums[i]);
  }
  sort(nums, nums + quant);
  for (long int i = 0; i < quant; i++) {
    if (nums[i] % mul != 0 || s.count(nums[i] / mul) == 0) {
      s.insert(nums[i]);
    }
  }
  printf("%ld\n", s.size());
  free(nums);
  return 0;
}
