#include <iostream>
#define SIZE 1000001
using namespace std;
long long n, k, a, cnt[SIZE], i, j, x = 0;
int main() {
cin >> n >> k;
for (i = 0; i < n; ++i) {
cin >> a;
++cnt[a];
}
for (i = k + 1; i < SIZE; ++i) {
if (cnt[i] > 0) {
for (j = k; j < SIZE; j += i)
if (cnt[j] > 0) {
if (i == j) {
x += cnt[i] * (cnt[i] - 1);
}
else {
x += cnt[j] * cnt[i];
}
}
}
}
cout << x << endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojZGVmaW5lIFNJWkUgMTAwMDAwMQp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmxvbmcgbG9uZyBuLCBrLCBhLCBjbnRbU0laRV0sIGksIGosIHggPSAwOwppbnQgbWFpbigpIHsKICAgIGNpbiA+PiBuID4+IGs7CiAgICBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKSB7CiAgICAgICAgY2luID4+IGE7CiAgICAgICAgKytjbnRbYV07CiAgICB9CiAgICBmb3IgKGkgPSBrICsgMTsgaSA8IFNJWkU7ICsraSkgewogICAgICAgIGlmIChjbnRbaV0gPiAwKSB7CiAgICAgICAgICAgIGZvciAoaiA9IGs7IGogPCBTSVpFOyBqICs9IGkpCiAgICAgICAgICAgICAgICBpZiAoY250W2pdID4gMCkgewogICAgICAgICAgICAgICAgICAgIGlmIChpID09IGopIHsKICAgICAgICAgICAgICAgICAgICAJeCArPSBjbnRbaV0gKiAoY250W2ldIC0gMSk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgICAgIAl4ICs9IGNudFtqXSAqIGNudFtpXTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CiAgICBjb3V0IDw8IHggPDwgZW5kbDsKfQ==