n,m=io.read("*n","*n","*l")
a={}
for i=1,n do
    a[i]={}
    a[i][1],a[i][2]=io.read("*n","*n")
end
table.sort(a,function(x,y)
    if x[1]~=y[1] then
        return x[1]<y[1]
    else
        return x[2]>y[2]
    end
end)

drink=0
yen=0
for i=1,n do
    if m-drink<a[i][2] then
        yen=yen+a[i][1]*(m-drink)
        break
    else
        drink=drink+a[i][2]
        yen=yen+a[i][1]*a[i][2]
    end
end
print(yen)