#include <bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define int long long
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

signed main(){
	int n,s;
	while(1){
		cin>>n>>s;
		if(n+s==0) break;
		vi r(n,0);
		rep(i,0,n) cin>>r[i];

		sort(all(r));
		int ans=0;
		rep(i,0,n-1){
			int it=max((int)(upper_bound(all(r),s-r[i])-r.begin()),(int)(i+1));
			ans+=n-it;
		}
		o(ans);
	}
}