N,M=gets.split.map(&:to_i)
ABS=N.times.map { gets.split.map(&:to_i) }
ABS = ABS.sort {|a,b| a[0] <=> b[0]}

cnt=0
sum=0
N.times do |i|
  ABS[i][1].times do
    sum+=ABS[i][0]
    cnt+=1
    break if cnt==M
  end
  break if cnt==M
end

p sum
