read N M
ANS=0

sort -nk1,1 | while read A B; do
    if ((B <= M)); then
        ((ANS+=A*B))
        ((M-=B))
    else
        ((ANS+=M*A))
        M=0
    fi
    
    if (( M == 0 )); then
        echo $ANS
        exit
    fi
done