
import std.stdio, std.algorithm;

void main() {
  for(int n, s; readf("%d %d\n", &n, &s), n != 0;) {
    int[] arr = new int[](n);
    int ans;
    foreach(i; 0..n) readf("%d\n", &arr[i]);
    sort(arr);
    for(int i = 0; i < arr.length; i++) {
      for(int j = i + 1; j < arr.length; j++) {
        if (s < arr[i] + arr[j]) ans++;
      }
    }
    writeln(ans);
  }
}