#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>

#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define vi vector<int>
#define VS vector<string>
#define all(x) x.begin(),x.end()
#define mp make_pair
#define pb push_back

using namespace std;

int main(){
    int n, S;
    while(cin >> n >> S, n+S){
        vi r;
        for(int i=0; i < n; i++){
            int m;
            cin >> m;
            r.push_back(m);
        }
        int ans = 0;
        for(int i=0; i < r.size(); i++){
            for(int j=0; j < i; j++){
                if(S < r[i]+r[j]) ans++;
            }
        }
        cout << ans << endl;
    }
}