implicit none

integer n,m,l,counts
 integer(8) :: cost=0
 integer tmp_a,tmp_b
 integer a(100000),b(100000)
 integer i,j,k
  
  read(5,*)n,m
 
  do i=1,n
    read(5,*)a(i),b(i)
    enddo
  
 do j=1,n
 do k=j+1,n
      if (a(j) > a(k)) then
        tmp_a =  a(j)
        a(j) = a(k)
        a(k) = tmp_a
        tmp_b =  b(j)
        b(j) = b(k)
        b(k) = tmp_b
    endif
    enddo
    enddo

  
  counts=m
  
  do l=1,n
   if(b(l)>counts) then
     cost= cost +a(l)*counts
     counts=0
     exit
   else
    cost= cost+a(l)*b(l)
    counts=counts-b(l)
   endif
  enddo
  
 write(6,*)cost
  
  
end
