n, m = gets.split.map(&:to_i)
AB = []
n.times do
    AB << gets.split.map(&:to_i)
end
ans = 0    
AB.sort_by{|ab| ab[0]}.each do |price, number|
    num_purchase = [m, number].min
    ans += price * num_purchase
    m -= num_purchase
end
p ans