N,M=map(int,input().split())
A=dict()
ans=0
A=[list(map(int,input().split()))for i in range(N)]
A.sort()
for i in range(N):
    if M>A[i][1]:
        M-=A[i][1]
        ans+=A[i][0]*A[i][1]
    else:
        ans+=A[i][0]*M
        break
print(ans) N,M=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split M A=dict() A dict() dict ans=0 ans 0 list(map(int,input().split()))for i in range(N) for i in range(N) i range(N) range N for i in range(N) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split A=[list(map(int,input().split()))for i in range(N)] A [list(map(int,input().split()))for i in range(N)] A.sort() A.sort A sort for i in range(N):
    if M>A[i][1]:
        M-=A[i][1]
        ans+=A[i][0]*A[i][1]
    else:
        ans+=A[i][0]*M
        break i range(N) range N if M>A[i][1]:
        M-=A[i][1]
        ans+=A[i][0]*A[i][1]
    else:
        ans+=A[i][0]*M
        break M>A[i][1] M A[i][1] [i] A i 1 M-=A[i][1] M A[i][1] [i] A i 1 ans+=A[i][0]*A[i][1] ans A[i][0]*A[i][1] A[i][0] [i] A i 0 A[i][1] [i] A i 1 ans+=A[i][0]*M ans A[i][0]*M A[i][0] [i] A i 0 M break print(ans) print ans A=dict() dict() A N,M=map(int,input().split()) map(int,input().split()) N ans=0 0 ans ans+=A[i][0]*M A[i][0]*M ans M-=A[i][1] A[i][1] M ans+=A[i][0]*A[i][1] A[i][0]*A[i][1] ans M=map(int,input().split()) map(int,input().split()) M A=[list(map(int,input().split()))for i in range(N)] [list(map(int,input().split()))for i in range(N)] A
N,M=map(int,input().split())
A=dict()
ans=0
A=[list(map(int,input().split()))for i in range(N)]
A.sort()
for i in range(N):
    if M>A[i][1]:
        M-=A[i][1]
        ans+=A[i][0]*A[i][1]
    else:
        ans+=A[i][0]*M
        break
print(ans)
