n,m = gets.split.map(&:to_i)
a = n.times.map{gets.split.map(&:to_i)}.sort_by{|i,j|i}
ans = 0
n.times do |i|
    if a[i][1] <= m
        ans += a[i][0]*a[i][1]
        m -= a[i][1]
    else
        ans += a[i][0]*m
        m = 0
    end
    break if m == 0
end
puts ans