n,k=map(int,input().split())
s=0
l=[]
for i in range(n):
    l.append(list(map(int,input().split())))
l.sort()
for i in range(n):
    if(l[i][1]<=k):
        s+=l[i][0]*l[i][1]
        k-=l[i][1]
    else:
        s+=l[i][0]*k
        k=0
    if(k==0):
        break
print(s) n,k=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k s=0 s 0 l=[] l [] for i in range(n):
    l.append(list(map(int,input().split()))) i range(n) range n l.append(list(map(int,input().split()))) l.append l append list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split l.sort() l.sort l sort for i in range(n):
    if(l[i][1]<=k):
        s+=l[i][0]*l[i][1]
        k-=l[i][1]
    else:
        s+=l[i][0]*k
        k=0
    if(k==0):
        break i range(n) range n if(l[i][1]<=k):
        s+=l[i][0]*l[i][1]
        k-=l[i][1]
    else:
        s+=l[i][0]*k
        k=0
     l[i][1]<=k l[i][1] [i] l i 1 k s+=l[i][0]*l[i][1] s l[i][0]*l[i][1] l[i][0] [i] l i 0 l[i][1] [i] l i 1 k-=l[i][1] k l[i][1] [i] l i 1 s+=l[i][0]*k s l[i][0]*k l[i][0] [i] l i 0 k k=0 k 0 if(k==0):
        break k==0 k 0 break print(s) print s s+=l[i][0]*l[i][1] l[i][0]*l[i][1] s s=0 0 s n,k=map(int,input().split()) map(int,input().split()) n k-=l[i][1] l[i][1] k k=0 0 k l=[] [] l s+=l[i][0]*k l[i][0]*k s k=map(int,input().split()) map(int,input().split()) k
n,k=map(int,input().split())
s=0
l=[]
for i in range(n):
    l.append(list(map(int,input().split())))
l.sort()
for i in range(n):
    if(l[i][1]<=k):
        s+=l[i][0]*l[i][1]
        k-=l[i][1]
    else:
        s+=l[i][0]*k
        k=0
    if(k==0):
        break
print(s)
