#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>

using namespace std;
int r[20000];
int main(void){

	int n, s;
	while (true){
		cin >> n >> s;
		int cnt[101] = { 0 };
		if (n == 0 && s == 0)return 0;
		for (int i = 0; i < n; i++)
		{
			cin >> r[i];
			for (int j = 0; j <= r[i]; j++)
				cnt[j]++;
		}
		int res = 0;
		for (int i = 0; i < n; i++)
		{
			res += cnt[max(0, s - r[i]+1)];
			if (r[i] * 2 > s)res--;
		}
		cout << res/2 << endl;
		

	}

	return 0;
}