#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n;
long p;
cin >> n >> p;
vector<int> v(n);
for (int i = 0; i < n; i++)
cin >> v[i];
sort(v.begin(), v.end());
int result = 0, temp = 0;
for (int i = 0; i < v.size(); i++) {
for (int j = i + result; j < n; j++) {
if(v[j] <= v[i] * p){
temp = j - i + 1;
if(temp > result) result = temp;
}else break;
}
}
cout << result << endl;
return 0;
}