#include<iostream>
using namespace std;

int main() {
	int n, s;
	while (cin >> n >> s, n, s) {
		int a[22000];
		for (int i = 0;i < n;i++)cin >> a[i];
		int ans = 0;
		for (int i = 0;i < n;i++)
		for (int j = i + 1;j < n;j++)
		if (s < a[i] + a[j])ans++;
		cout << ans << endl;
	}
}