// Aizu Vol-10 1085: Spellcasters
// 2017.8.19 bal4u@uu

#include <stdio.h>
#include <string.h>

int c[105];

int main()
{
	int n, S, r;
	int i, j, ans;

	while (scanf("%d%d", &n, &S) && n) {
		memset(c, 0, sizeof(c));
		for (i = 0; i < n; i++) scanf("%d", &r), c[r]++;
		for (ans = i = 0; i < S; i++) {
			if (!c[i]) continue;
			if (i + i <= S) ans += c[i] * (c[i]-1) / 2;
			for (j = i + 1; j < S; j++)
				if (c[j] && i + j <= S) ans += c[i] * c[j];
		}
		printf("%d\n", n*(n-1) / 2 - ans);
	}
	return 0;
}