N, M = gets.split.map(&:to_i)
a = Array.new(N,Array.new(2,0))
ans = 0
bought = 0
N.times do |i|
  a[i] = gets.split.map(&:to_i)
end

a = a.sort
p a
i = 0
#B本買うまで一個ずつ買う
while bought < M do
  #n件目の本数がゼロでなければ一本買う
  if a[i][1]>0 then
    ans = ans+ a[i][0]
    a[i][1] = a[i][1]-1
    bought = bought+1
  else
  #n件目の本数がゼロならば店を移る
    i = i+1
  end
end

puts ans