#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int main()
{
int N, P, Max = 0;
cin>>N>>P;
vector<long long int> numbers(N);
for(int i = 0; i < N; i++)
scanf("%d", &(numbers[i]));
sort(numbers.begin(), numbers.end());
auto end_itr = numbers.begin();
for(auto start_itr = numbers.begin(); start_itr != numbers.end(); start_itr ++){
long long int limit = *start_itr * P;
while(end_itr != numbers.end() && *end_itr <= limit)
end_itr ++;
Max = max(Max, (int)(end_itr-start_itr));
}
cout<<Max<<endl;
}