N,M=gets.split.map(&:to_i)
price,stock=N.times.map{gets.split.map(&:to_i)}.sort_by{|x| x[0]}.transpose

count=0
total_cost=0

N.times {|a|
    if M-count>stock[a]
        total_cost+=price[a]*stock[a]
        count+=stock[a]
    else
        total_cost+=price[a]*(M-count)
        break
    end
}

puts total_cost