class Pair
  attr_accessor :first,:second
end

def make_pair(x,y)
  temp = Pair.new
  temp.first = x
  temp.second = y
  return temp
end

n, m = gets.chomp.split.map(&:to_i)
s = []
n.times do |i|
  a, b = gets.chomp.split.map(&:to_i)
  s.push(make_pair(a, b))
end
s = s.sort{|i, j| i.first <=> j.first}
c = 0
n.times do |i|
  if m >= s[i].second
    m -= s[i].second
    c += s[i].first * s[i].second
  else
    s[i].second.times do |j|
      if m > 0
        c += s[i].first
        m -= 1
      else
        break
      end
    end
  end
end
p c
exit