n, m = gets.chomp.split(" ").map(&:to_i)
arr = []
n.times do |i|
    a = gets.chomp.split(" ").map(&:to_i)
    arr << a
end

arr = arr.sort
i = 0
count = 0
me = 0
# p arr
while true
    a, b = arr.shift
    # p a
    # p b
    me = i + b
    if me < m
        i += b
        count += a * b
    else
        sa = m - i
        count += a * sa
        puts count
        break
    end
    # p i
    # p count
end

