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

shops = n.times.map do
  gets.split.map(&:to_i)
end.sort

ans = shops.inject([0, 0]) do |memo, shop|
  if memo[1] < m
    count = [m-memo[1], shop[1]].min
    memo[0] += count * shop[0]
    memo[1] += count
  end
  memo
end

puts ans[0]
