raw1 = gets.split(" ").map{|nn|nn.to_i}
n = raw1[0]
request_amount = raw1[1]

class Shop
  attr_accessor :price,:amount
  def initialize(a,b)
    self.price = a;
    self.amount = b;
  end

  def <=> (other)
    return self.price - other.price
  end
end

shops = []
n.times do
  raw = gets.split(" ").map{|nn|nn.to_i}
  shops << Shop.new(raw[0],raw[1])
end

shops.sort!{|nn,mm| nn <=> mm};
money = 0
bought = 0
shops.each{|elem|
  while(bought < request_amount)
    money += elem.price
    bought += 1
    elem.amount -= 1
    break if elem.amount == 0
  end
}

puts money.to_s