# util functions

# debug
$debugFlag = ( ARGV[0] != nil )
p "==== DEBUG MODE ====" if $debugFlag

# input
inputs = []
lc = 0
while l = $stdin.gets do
  if false
    inputs << l.chomp.split(" ").map(&:to_s)
  else
    inputs << l.chomp.split(" ").map(&:to_i)
  end
  lc += 1
end

# input check
if $debugFlag
  p "--- INPUT (begin) ---"
  inputs.each do |l_i|
    p l_i
  end
  p "--- INPUT (end) ---"
  print "\n"
end

mm   = inputs[0][1]
list = inputs[1..-1]

# body
list.sort_by!{|c, n| c }
if $debugFlag
  p mm
  p list
end

cost = 0
got  = 0
idx  = 0
while mm - got > 0
  delta = [ list[idx][1], mm - got ].min
  cost += list[idx][0]*delta
  got  += delta
  idx += 1
end

puts cost
