
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++) {
      int lb = i, ub = n;
      while(ub - lb > 1) {
        int mid = (lb + ub) / 2;
        if (arr[mid] + arr[i] > s) ub = mid;
        else lb = mid;
      }
      ans += (n - ub);
    }
    writeln(ans);
  }
}