#float型を許すな
#numpyはpythonで
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

n,m=MI()
lis=[LI() for i in range(n)]
lis.sort()
pay=0
i=0
while m>0:
    pay+=lis[i][0]*min(m,lis[i][1])
    m-=min(m,lis[i][1])
    i+=1
print(pay)
    
    
    
    

     import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline sys.setrecursionlimit(10**7) sys.setrecursionlimit sys setrecursionlimit 10**7 10 7 from collections import Counter, deque from collections import defaultdict from itertools import combinations, permutations, accumulate, groupby, product from bisect import bisect_left,bisect_right from heapq import heapify, heappop, heappush from math import floor, ceil,pi,factorial from operator import itemgetter def I(): return int(input()) I def MI(): return map(int, input().split()) MI def LI(): return list(map(int, input().split())) LI int(input()) for i in range(n) for i in range(n) i range(n) range n for i in range(n) int(input()) int input() input def LI2(): return [int(input()) for i in range(n)] LI2 [LI()]for i in range(n) for i in range(n) i range(n) range n for i in range(n) [LI()] LI() LI def MXI(): return [[LI()]for i in range(n)] MXI def SI(): return input().rstrip() SI def printns(x): print('\n'.join(x)) printns x x def printni(x): print('\n'.join(list(map(str,x)))) printni x x inf = 10**17 inf 10**17 10 17 mod = 10**9 + 7 mod 10**9 + 7 10**9 10 9 7 n,m=MI() n MI() MI m LI() for i in range(n) for i in range(n) i range(n) range n for i in range(n) LI() LI lis=[LI() for i in range(n)] lis [LI() for i in range(n)] lis.sort() lis.sort lis sort pay=0 pay 0 i=0 i 0 while m>0:
    pay+=lis[i][0]*min(m,lis[i][1])
    m-=min(m,lis[i][1])
    i+=1 m>0 m 0 pay+=lis[i][0]*min(m,lis[i][1]) pay lis[i][0]*min(m,lis[i][1]) lis[i][0] [i] lis i 0 min(m,lis[i][1]) min m lis[i][1] [i] lis i 1 m-=min(m,lis[i][1]) m min(m,lis[i][1]) min m lis[i][1] [i] lis i 1 i+=1 i 1 print(pay) print pay m-=min(m,lis[i][1]) min(m,lis[i][1]) m def I(): return int(input()) def I(): return int(input()) I def MXI(): return [[LI()]for i in range(n)] def MXI(): return [[LI()]for i in range(n)] MXI pay=0 0 pay i+=1 1 i def printni(x): print('\n'.join(list(map(str,x)))) def printni(x): print('\n'.join(list(map(str,x)))) printni def MI(): return map(int, input().split()) def MI(): return map(int, input().split()) MI lis=[LI() for i in range(n)] [LI() for i in range(n)] lis def LI2(): return [int(input()) for i in range(n)] def LI2(): return [int(input()) for i in range(n)] LI2 inf = 10**17 10**17 inf mod = 10**9 + 7 10**9 + 7 mod input = sys.stdin.readline sys.stdin.readline input def SI(): return input().rstrip() def SI(): return input().rstrip() SI i=0 0 i def LI(): return list(map(int, input().split())) def LI(): return list(map(int, input().split())) LI def printns(x): print('\n'.join(x)) def printns(x): print('\n'.join(x)) printns n,m=MI() MI() n pay+=lis[i][0]*min(m,lis[i][1]) lis[i][0]*min(m,lis[i][1]) pay m=MI() MI() m
#float型を許すな
#numpyはpythonで
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

n,m=MI()
lis=[LI() for i in range(n)]
lis.sort()
pay=0
i=0
while m>0:
    pay+=lis[i][0]*min(m,lis[i][1])
    m-=min(m,lis[i][1])
    i+=1
print(pay)
    
    
    
    

    
