n,m=map(int,input().split())
a=[]
b=[]
for i in range(n):
    s=list(map(int,input().split()))
    a.append(s[0])
    b.append(s[1])
c=zip(a,b)
d=sorted(c)
#print(d)
#print(d[0][1])
yen=0
btl=0
for i in range(n):
    if d[i][1]+btl<m:
        yen+=d[i][0]*d[i][1]
        btl+=d[i][1]
    elif d[i][1]+btl>=m:
        yen+=d[i][0]*(m-btl)
        btl=m
    if btl==m:
        print(yen)
        exit() n,m=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m a=[] a [] b=[] b [] for i in range(n):
    s=list(map(int,input().split()))
    a.append(s[0])
    b.append(s[1]) i range(n) range n s=list(map(int,input().split())) s list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split a.append(s[0]) a.append a append s[0] s 0 b.append(s[1]) b.append b append s[1] s 1 c=zip(a,b) c zip(a,b) zip a b d=sorted(c) d sorted(c) sorted c yen=0 yen 0 btl=0 btl 0 for i in range(n):
    if d[i][1]+btl<m:
        yen+=d[i][0]*d[i][1]
        btl+=d[i][1]
    elif d[i][1]+btl>=m:
        yen+=d[i][0]*(m-btl)
        btl=m
    if btl==m:
        print(yen)
        exit() i range(n) range n if d[i][1]+btl<m:
        yen+=d[i][0]*d[i][1]
        btl+=d[i][1]
    elif d[i][1]+btl>=m:
        yen+=d[i][0]*(m-btl)
        btl=m
     d[i][1]+btl<m d[i][1]+btl d[i][1] [i] d i 1 btl m yen+=d[i][0]*d[i][1] yen d[i][0]*d[i][1] d[i][0] [i] d i 0 d[i][1] [i] d i 1 btl+=d[i][1] btl d[i][1] [i] d i 1 elif d[i][1]+btl>=m:
        yen+=d[i][0]*(m-btl)
        btl=m
     d[i][1]+btl>=m d[i][1]+btl d[i][1] [i] d i 1 btl m yen+=d[i][0]*(m-btl) yen d[i][0]*(m-btl) d[i][0] [i] d i 0 m-btl m btl btl=m btl m if btl==m:
        print(yen)
        exit() btl==m btl m print(yen) print yen exit() exit yen+=d[i][0]*(m-btl) d[i][0]*(m-btl) yen btl=0 0 btl m=map(int,input().split()) map(int,input().split()) m c=zip(a,b) zip(a,b) c n,m=map(int,input().split()) map(int,input().split()) n btl+=d[i][1] d[i][1] btl s=list(map(int,input().split())) list(map(int,input().split())) s btl=m m btl yen=0 0 yen b=[] [] b a=[] [] a d=sorted(c) sorted(c) d yen+=d[i][0]*d[i][1] d[i][0]*d[i][1] yen
n,m=map(int,input().split())
a=[]
b=[]
for i in range(n):
    s=list(map(int,input().split()))
    a.append(s[0])
    b.append(s[1])
c=zip(a,b)
d=sorted(c)
#print(d)
#print(d[0][1])
yen=0
btl=0
for i in range(n):
    if d[i][1]+btl<m:
        yen+=d[i][0]*d[i][1]
        btl+=d[i][1]
    elif d[i][1]+btl>=m:
        yen+=d[i][0]*(m-btl)
        btl=m
    if btl==m:
        print(yen)
        exit()