
n, w = gets.split(" ").map(&:to_i)

class Value
    attr_reader :data, :key
    def initialize(x)
        @data = x
        @key = x[0].to_f / x[1].to_f
    end

    def <=>(t)
        if @key < t.key then
            return 1
        elsif @key > t.key then
            return -1
        end

        return 0
    end
end

a = []
n.times do |i|
    a[i] = Value.new(gets.split(" ").map(&:to_i))
end

a = a.sort

point = 0
# k, v, w
a.each do |x|
    f = x.data[1] < w ? x.data[1] : w
    point += f * x.key
    w -= f
end

print point, "\n"

