#include<stdio.h>
int N,S,R[20005],r,i,j;

int main()
{
	for(;scanf("%d%d",&N,&S),N;)
	{
		r=0;
		for(i=0;i<N;i++)scanf("%d",&R[i]);
		for(i=0;i<N;i++)
			for(j=i+1;j<N;j++)
				if(R[i]+R[j]>S)r++;
		printf("%d\n",r);
	}
	return 0;
}