#include <iostream>
#include <queue>
#include <cstdio>

using namespace std;

int main(void)
{
	int n, s;
	int magic[20500];
	
	while (cin >> n >> s, n && s){
		for (int i = 0; i < n; i++){
			scanf("%d", &magic[i]);
		}
		
		int ret = 0;
		for (int i = 0; i < n; i++){
			for (int j = i + 1; j < n; j++){
				if (magic[i] + magic[j] > s) ret++;
			}
		}
		
		cout << ret << endl;
	}
	
	return 0;
}