N, M = $stdin.readline.split(" ").map(&:to_i)

lines = $stdin.read.split("\n").map{|l| l.split(" ").map(&:to_i)}.lines.sort_by{|x| x[0]}

m = M
min = 0
lines.each do |line|
  line[1].times do
    min += line[0]
    m -= 1
    break if m == 0
  end
end

puts min
