#include<iostream>
#include<cstdio>
#include<map>
using namespace std;
map<long long,int>mp;
int main(void){
long long a, b, c, i, maxx = 0;
scanf("%lld %lld",&a,&b);
while(a--){
scanf("%lld",&c);
mp[c]++;
if(mp[c] > maxx){
maxx = mp[c];
}
for(i = 2;i <= b;i++){
if(c % i == 0){
mp[c / i]++;
if(mp[c / i] > maxx){
maxx = mp[c / i];
}
}
}
}
printf("%lld\n",maxx);
return 0;
}