#include <iostream>
using namespace std;

const int N_MAX = 20000;
int rs[N_MAX];

int main() {
    int n, s;
    while (cin >> n >> s, n|s) {
        for (int i = 0; i < n; i++) {
            cin >> rs[i];
        }
        int ans = 0;
        for (int i = 0; i + 1 < n; i++) {
            for (int j = i + 1; j < n; j++) {
                if (rs[i] + rs[j] > s) {
                    ans++;
                }
            }
        }
        cout << ans << endl;
    }
}