/*
AizuOnline A1085
Title spellcasters
*/
#include <stdio.h>
// Select Below
#include <stdlib.h>
//#include <string.h>
//#include <float.h>
//#include <math.h>
//#include <limits.h>
//Global data section

int n,S,r[20000];
//
int comp(void * x,void * y)
{
  int a,b;
  a = *(int *)x;b= *(int *)y;
  return(a-b);
}


main()
{
  int i,j,cnt;

  while(EOF != scanf("%d %d",&n,&S) && (n || S))
    {
      for(i=0;i<n;i++)
	scanf("%d",&(r[i]));

      cnt=0;
      printf("N:%d\n",n);
      qsort(r,n,sizeof(int),(__compar_fn_t)comp);
      /*
      for(i=0;i<n;i++)
	printf("%d:",r[i]);
      printf("\n");
      */
      for(i=0;i<n-1;i++)
	for(j=i+1;j<n;j++)
	  if(r[i]+r[j] > S)
	    {  cnt += (n-j); 
	      break;
	    }

      printf("%d\n",cnt);

    }

return(0);
}