#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
const int MAX_N = 100010;
int n;
vector<long long> arr;
long long p,temp;
int main() {
cin >> n >> p;
for(int i = 0; i < n; i++) {
cin>>temp;
arr.push_back(temp);
}
sort(arr.begin(),arr.end());
int sum = 0;
for(int i = 0, j = 0; i < n; i++) {
while(j < n && arr[i] > arr[j] * p)
j++;
sum = max(sum, i - j + 1);
}
cout<<sum;
return 0;
}