import sys
n,m=map(int,input().split())
ab=[]
for i in range(n):
    ab.append(list(map(int,input().split())))

ab=sorted(ab,key=lambda x:x[0])

ans=0
for i in range(n):
    c=ab[i][1]
    if c<m:
        ans+=ab[i][0]*c
        m-=c
    else:
        ans+=ab[i][0]*m
        print(ans)
        sys.exit()
        
     import sys sys n,m=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m ab=[] ab [] for i in range(n):
    ab.append(list(map(int,input().split()))) i range(n) range n ab.append(list(map(int,input().split()))) ab.append ab append list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split ab=sorted(ab,key=lambda x:x[0]) ab sorted(ab,key=lambda x:x[0]) sorted ab key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x ans=0 ans 0 for i in range(n):
    c=ab[i][1]
    if c<m:
        ans+=ab[i][0]*c
        m-=c
    else:
        ans+=ab[i][0]*m
        print(ans)
        sys.exit()
        
     i range(n) range n c=ab[i][1] c ab[i][1] [i] ab i 1 if c<m:
        ans+=ab[i][0]*c
        m-=c
    else:
        ans+=ab[i][0]*m
        print(ans)
        sys.exit()
        
     c<m c m ans+=ab[i][0]*c ans ab[i][0]*c ab[i][0] [i] ab i 0 c m-=c m c ans+=ab[i][0]*m ans ab[i][0]*m ab[i][0] [i] ab i 0 m print(ans) print ans sys.exit() sys.exit sys exit ab=[] [] ab m-=c c m m=map(int,input().split()) map(int,input().split()) m n,m=map(int,input().split()) map(int,input().split()) n ans+=ab[i][0]*c ab[i][0]*c ans ab=sorted(ab,key=lambda x:x[0]) sorted(ab,key=lambda x:x[0]) ab ans+=ab[i][0]*m ab[i][0]*m ans ans=0 0 ans c=ab[i][1] ab[i][1] c
import sys
n,m=map(int,input().split())
ab=[]
for i in range(n):
    ab.append(list(map(int,input().split())))

ab=sorted(ab,key=lambda x:x[0])

ans=0
for i in range(n):
    c=ab[i][1]
    if c<m:
        ans+=ab[i][0]*c
        m-=c
    else:
        ans+=ab[i][0]*m
        print(ans)
        sys.exit()
        
    
