n,m =$stdin.gets.split.map(&:to_i)
ary = []
cnt = 0
result = 0
n.times do |i|
  ary.push($stdin.gets.split.map(&:to_i))
end
ary.sort!
n.times do |i|
  if cnt + ary[i][1]<=m
    cnt += ary[i][1]
    result += ary[i][0] * ary[i][1]
  else
    result += ary[i][0] * (m - cnt)
    break
  end
end
puts result
