while gets
  n, s = $_.split.map(&:to_i)
  break if n == 0 
  l = Array.new
  n.times do
    l << gets.to_i
  end
  l.sort!
  cnt = 0
  for i in 0...n
    for j in (i+1)...n
      if l[i] + l[j] > s
        cnt += n - j
      end
    end
  end
  p cnt 
end