import std.stdio, std.string, std.conv, std.algorithm, std.array;

void main()
{
  while( true ) {
	string[] token = split( strip( readln ) );
	int n = to!int( token[ 0 ] );
	int s = to!int( token[ 1 ] );
	if ( n == 0 && s == 0 ) break;

	int[] r = new int[]( n );
	foreach ( i; 0 .. n ) {
	  r[ i ] = to!int( strip( readln ) );
	}
	sort( r );
	int k = 0;
	int l = n - 1;
	int ans = 0;
	while ( k < l ) {
	  while ( k < l && r[ k ] + r[ l ] > s ) {
		l--;
	  }
	  ans += n - 1 - l;
	  k++;
	}
	foreach ( i; k .. n ) {
	  ans += n - 1 - i;
	}
	writeln( ans );
  }
}