#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<queue>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int inf = 0x3f3f3f3f;
const int maxn = 1e5 + 10;
const ll mod = 1e9 + 7;
int n;
ll k;
ll len[maxn];
map<ll, int>mp;
set<ll>s;
int main()
{
scanf("%d %lld", &n, &k);
for(int i = 1; i <= n; i++)
{
scanf("%lld", &len[i]);
for(ll j = 1; j <= k; j++)
{
if(len[i] % j == 0)
{
mp[len[i] / j]++;
s.insert(len[i] / j);
}
}
}
int ans = 1;
for(set<ll>::iterator it = s.begin(); it != s.end(); it++)
{
ans = max(ans, mp[*it]);
}
cout << ans << endl;
}