n, m = gets.chomp.split.map(&:to_i)
a = []
n.times do |i|
  a[i] = gets.chomp.split.map(&:to_i)
end

ans = 0
short = m
a.sort.each do |money, count|
  if count >= short
    ans += short * money
    break
  else
    ans += count * money
    short -= count
  end
end
p ans
