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

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

  result = 0
  (casters.size - 1).times {|i| result += casters[i+1..-1].count {|n| casters[i] + n > s } }
  puts result
end