N, M = gets.split(' ')

a = []

N.to_i.times do |i|
    a[i] = gets.split(' ')
    a[i][0] = a[i][0].to_i
    a[i][1] = a[i][1].to_i
end

n = a.sort_by{|x| x}

i = 0
count = 0
cost = 0
while count < M.to_i do
    if n[i][1] > 0 then
        n[i][1] = n[i][1] - 1
        cost = cost + n[i][0]
        count = count + 1
    else
        n.shift
    end
end

print cost