#include <stdio.h>
#include <stdlib.h>

#define N 20000

int
main (
  int   argc,
  char *argv[ ]
  )
{
  int i, j;

  for ( ; ; )
  {
    int n, s;
    int r[ N ];
    int c = 0;

    scanf ( "%d%d", &n, &s );
    if ( n == 0 && s == 0 ) break ;
    for ( i = 0; i < n; ++i )
      scanf ( "%d", &r[ i ] );

    for ( i = 0; i < n; ++i )
    for ( j = i + 1; j < n; ++j )
      c += !!( r[ i ] + r[ j ] > s );

    printf ( "%d\n", c );
  }

  return ( EXIT_SUCCESS );
}