import sys
N,M=map(int,input().split())
A=[list(map(int,input().split())) for i in range(N)]
A=sorted(A,key=lambda x:x[0])
cost=0
num=0
for i in range(N):
    if num+A[i][1]>M:
        print(cost+A[i][0]*(M-num))
        sys.exit()
    else:
        cost+=A[i][0]*A[i][1]
        num+=A[i][1]
print(cost) import sys sys N,M=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split M 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=sorted(A,key=lambda x:x[0]) A sorted(A,key=lambda x:x[0]) sorted A key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x cost=0 cost 0 num=0 num 0 for i in range(N):
    if num+A[i][1]>M:
        print(cost+A[i][0]*(M-num))
        sys.exit()
    else:
        cost+=A[i][0]*A[i][1]
        num+=A[i][1] i range(N) range N if num+A[i][1]>M:
        print(cost+A[i][0]*(M-num))
        sys.exit()
    else:
        cost+=A[i][0]*A[i][1]
        num+=A[i][1] num+A[i][1]>M num+A[i][1] num A[i][1] [i] A i 1 M print(cost+A[i][0]*(M-num)) print cost+A[i][0]*(M-num) cost A[i][0]*(M-num) A[i][0] [i] A i 0 M-num M num sys.exit() sys.exit sys exit cost+=A[i][0]*A[i][1] cost A[i][0]*A[i][1] A[i][0] [i] A i 0 A[i][1] [i] A i 1 num+=A[i][1] num A[i][1] [i] A i 1 print(cost) print cost N,M=map(int,input().split()) map(int,input().split()) N A=[list(map(int,input().split())) for i in range(N)] [list(map(int,input().split())) for i in range(N)] A cost+=A[i][0]*A[i][1] A[i][0]*A[i][1] cost M=map(int,input().split()) map(int,input().split()) M cost=0 0 cost num+=A[i][1] A[i][1] num num=0 0 num A=sorted(A,key=lambda x:x[0]) sorted(A,key=lambda x:x[0]) A
import sys
N,M=map(int,input().split())
A=[list(map(int,input().split())) for i in range(N)]
A=sorted(A,key=lambda x:x[0])
cost=0
num=0
for i in range(N):
    if num+A[i][1]>M:
        print(cost+A[i][0]*(M-num))
        sys.exit()
    else:
        cost+=A[i][0]*A[i][1]
        num+=A[i][1]
print(cost)