1 #include<map>
2 #include<cstdio>
3 #include<algorithm>
4 using namespace std;
5 int n,p,a,ans;
6 int s[100010];
7 map <int,bool> v;
8 int main(){
9 scanf("%d%d",&n,&p);
10 ans=n;
11 for(int i=1;i<=n;i++){scanf("%d",&s[i]);v[s[i]]=1;}
12 sort(s+1,s+n+1);
13 for(int i=1;i<=n;i++){
14 if(s[i]*p<s[i]||s[i]*p>s[n]) break;
15 if(v[s[i]]){
16 a=s[i]*p;
17 if(v[a]){v[a]=0;ans--;}
18 }
19 }
20 printf("%d\n",ans);
21 return 0;
22 }