n, m = gets.chomp.split.map(&:to_i)
shop = []
result = 0
for x in 1..n
  shop << gets.chomp.split.map(&:to_i)
end
cheapershop = shop.sort!
drink_bought = 0
money_spent = 0
flag = false
for y in 0..n - 1
  if m - drink_bought > shop[y][1]
    money_spent = money_spent + shop[y][0] * shop[y][1]
    drink_bought = drink_bought + shop[y][1]
  elsif money_spent = money_spent + shop[y][0] * (m - drink_bought)
    drink_bought = m - drink_bought
    flag = true
  end
  if flag == true
    puts money_spent
    exit
  end
end
