require 'pp'
N,M = readline.chomp.split.map(&:to_i)
A = Array.new(N)
N.times do |i|
  a,b = readline.chomp.split.map(&:to_i)
  A[i] = [a,b]
end

A.sort_by! {|(a,b)| a }

sum = 0
sum_p = 0
A.each do |a,b|
  n = [M-sum, b].min
  sum += n
  sum_p += n * a
  break if sum == M
end

puts sum_p
