#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<sstream>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<climits>
#include<map>
#include<set>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define INF 1<<30
#define F first
#define S second
using namespace std;
typedef pair<int,int> P;
int counter[140],sum[140];
//this behaves as if this were counting sort

int calc(int c,int n){
  int cnt = 0;
  n--;
  for(int i=c;i>=1;i--){
    cnt += n;
    n--;
  }
  return cnt;
}

int main(){
  int n,S,r,mex;
  while(true){
    cin >> n >> S;
    if(n+S == 0)break;
    mex = 0;
    for(int i=0;i<140;i++){
      counter[i] = sum[i] = 0;
    }
    for(int i=0;i<n;i++){
      cin >> r;
      mex = mex<r?r:mex;
      counter[r]++; 
    }

    for(int i=mex;i>=0;i--){
      sum[i] = counter[i]+sum[i+1];
    }



    int cnt = 0;
    for(int i=0;i<=mex;i++){
      if(counter[i] == 0)continue;
      cnt += S-i+1<=i?calc(counter[i],sum[i]):counter[i]*sum[1+S-i];
    }
    cout << cnt << endl;

  }
return 0;
}