program main
	implicit none
    integer :: n, m
    integer(8), allocatable :: a(:), b(:)
    integer :: i, j, tmp1, tmp2
    integer(8) :: tenpo, kosu, amari
	integer(8) :: kakaku
	read(*, *) n, m
    allocate(a(n)); allocate(b(n))
    do i = 1, n
    	read(*, *) a(i), b(i)
    enddo
    do i = 1, n
    	do j = i+1, n
        	if (a(i).gt.a(j)) then
            	tmp1 = a(i)
                a(i) = a(j)
                a(j) = tmp1
                tmp2 = b(i)
                b(i) = b(j)
                b(j) = tmp2
            end if
		enddo
	enddo
    amari = m
    tenpo = 0
    do while (amari.gt.0)
    	tenpo = tenpo + 1
		amari = amari - b(tenpo)
    enddo
    kakaku = 0
    do i = 1, tenpo-1
    	kakaku = kakaku + a(i)*b(i)
    enddo
    kakaku = kakaku + a(tenpo)*(b(tenpo)+amari)
    write(*, *) kakaku
stop
end program main