while true
    n, s = gets.chomp.split.map(&:to_i)
    break if [n, s] == [0, 0]
    arr = Array.new(101, 0)
    n.times{arr[gets.to_i] += 1}
    cum = [n]
    1.upto(100){|i| cum[i] = cum[i - 1] - arr[i - 1]}
    sum = 0
    arr.each_with_index{|x, i| sum += x * (cum[[s - i + 1, 0].max] - ((s - i + 1 <= i) ? 1 : 0)) if x > 0}
    puts sum / 2
end
