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

ab=sorted(ab)
ans=0
d=m

for i in range(n):
    if ab[i][1]<=d:
        ans+=ab[i][0]*ab[i][1]
        d-=ab[i][1]
    else:
        
        ans+=ab[i][0]*d
        
        break
print(ans)
        
        
     n,m=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m [] for i in range(n) for i in range(n) i range(n) range n for i in range(n) [] ab=[[] for i in range(n)] ab [[] for i in range(n)] for i in range(n):
    a,b=map(int,input().split())
    ab[i].append(a)
    ab[i].append(b) i range(n) range n a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b ab[i].append(a) [i].append [i] ab i append a ab[i].append(b) [i].append [i] ab i append b ab=sorted(ab) ab sorted(ab) sorted ab ans=0 ans 0 d=m d m for i in range(n):
    if ab[i][1]<=d:
        ans+=ab[i][0]*ab[i][1]
        d-=ab[i][1]
    else:
        
        ans+=ab[i][0]*d
        
        break i range(n) range n if ab[i][1]<=d:
        ans+=ab[i][0]*ab[i][1]
        d-=ab[i][1]
    else:
        
        ans+=ab[i][0]*d
        
        break ab[i][1]<=d ab[i][1] [i] ab i 1 d ans+=ab[i][0]*ab[i][1] ans ab[i][0]*ab[i][1] ab[i][0] [i] ab i 0 ab[i][1] [i] ab i 1 d-=ab[i][1] d ab[i][1] [i] ab i 1 ans+=ab[i][0]*d ans ab[i][0]*d ab[i][0] [i] ab i 0 d break print(ans) print ans m=map(int,input().split()) map(int,input().split()) m ans+=ab[i][0]*ab[i][1] ab[i][0]*ab[i][1] ans ab=[[] for i in range(n)] [[] for i in range(n)] ab d=m m d d-=ab[i][1] ab[i][1] d ans+=ab[i][0]*d ab[i][0]*d ans ab=sorted(ab) sorted(ab) ab a,b=map(int,input().split()) map(int,input().split()) a b=map(int,input().split()) map(int,input().split()) b n,m=map(int,input().split()) map(int,input().split()) n ans=0 0 ans
n,m=map(int,input().split())
ab=[[] for i in range(n)]
for i in range(n):
    a,b=map(int,input().split())
    ab[i].append(a)
    ab[i].append(b)

ab=sorted(ab)
ans=0
d=m

for i in range(n):
    if ab[i][1]<=d:
        ans+=ab[i][0]*ab[i][1]
        d-=ab[i][1]
    else:
        
        ans+=ab[i][0]*d
        
        break
print(ans)
        
        
    
