n,m = gets.split().map(&:to_i)

as = []
bs = []
for i in 1..n do
    a,b = gets.split().map(&:to_i)
    as << a
    bs << b
end

sum = 0
ans = 0
for i in 1..n do
    index = as.index(as.min)
    if m - sum - bs[index] >= 0 then
        sum = sum + bs[index]
        ans = ans + as[index]*bs[index]
    else
        for j in 1..bs[index] do
            sum = sum + 1
            ans = ans + as[index]
            break if sum >= m
        end
    end

    break if sum >= m 

    as.delete_at(index)
    bs.delete_at(index)
end

p ans