#include<cstdio>
#include<iostream>
using namespace std;

int readInt(){
  int ret = 0;
  char c;
  while((c=getchar()) && '0' <= c && c <= '9'){
    ret = ret * 10 + (c-'0');
  }
  return ret;
}

int main(){
  int n,s;
  while(true){
    n = readInt();
    if (n==0)break;
    s = readInt();

    int r[101]={0};
    for(int i=0;i<n;i++){
      int tmp;tmp=readInt();r[tmp]++;
    }
    int ans = 0;
    for(int i=0;i<101;i++){
      if (i+i > s && r[i])ans += (r[i]*(r[i]-1))/2;
      for(int j=i+1;j<101;j++){
	if (i+j > s)ans += r[i]*r[j];
      }
    }
    printf("%d\n",ans);
  }
}