while true
  n, s = gets.chomp.split(' ').map(&:to_i)
  break if n == 0 && s == 0

  casters = n.times.map { gets.chomp.to_i }

  puts casters.combination(2).select {|arr| arr[0] + arr[1] > s }.size
end