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

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

ans = max_a
for i in 1..n do
    index = as.index(as.max)
    if max_s - m >= bs[index] then
        max_s = max_s - bs[index]
        ans = ans - as[index]*bs[index]
    else
        ans = ans - as[index]*(max_s-m)
        break
    end
    as.delete_at(index)
    bs.delete_at(index)
end

p ans