loop do
    n, m = gets.split.map(&:to_i)
    break if n == 0 && m == 0
    d = n.times.map{gets.split.map(&:to_i)}
    d.sort!{|a,b| b[1]<=>a[1]}
    ans = 0
    d.each do |dd|
        if m >= dd[0]
            m -= dd[0]
            dd[0] = 0
        else
            dd[0] -= m
            m = 0
        end
        ans += dd[0] * dd[1]
    end
    p ans
end