#include "bits/stdc++.h"
using namespace std;
const int N = 1e5 + 10;
long long a[N];
long long p;
int n, res;
int main() {
cin >> n >> p;
for (int i = 0; i < n; i ++) cin >> a[i];
sort(a, a + n);
for (int i = 0, j = 0; i < n; i ++) {
while (j < n && a[i] * p >= a[j]) j++;
res = max(res, j - i);
}
cout << res;
return 0;
}