N,M = map(int,input().split())
A = [list(map(int,input().split())) for i in range(N)]

A.sort()
sm = 0
cnt = 0

i = 0
while sm != M:
	cnt += A[i][0]*min(A[i][1],M-sm)
	sm += min(A[i][1],M-sm)
	i += 1

print(cnt) 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.sort() A.sort A sort sm = 0 sm 0 cnt = 0 cnt 0 i = 0 i 0 while sm != M:
	cnt += A[i][0]*min(A[i][1],M-sm)
	sm += min(A[i][1],M-sm)
	i += 1 sm != M sm M cnt += A[i][0]*min(A[i][1],M-sm) cnt A[i][0]*min(A[i][1],M-sm) A[i][0] [i] A i 0 min(A[i][1],M-sm) min A[i][1] [i] A i 1 M-sm M sm sm += min(A[i][1],M-sm) sm min(A[i][1],M-sm) min A[i][1] [i] A i 1 M-sm M sm i += 1 i 1 print(cnt) print cnt sm += min(A[i][1],M-sm) min(A[i][1],M-sm) sm M = map(int,input().split()) map(int,input().split()) M sm = 0 0 sm cnt += A[i][0]*min(A[i][1],M-sm) A[i][0]*min(A[i][1],M-sm) cnt N,M = map(int,input().split()) map(int,input().split()) N i = 0 0 i cnt = 0 0 cnt A = [list(map(int,input().split())) for i in range(N)] [list(map(int,input().split())) for i in range(N)] A i += 1 1 i
N,M = map(int,input().split())
A = [list(map(int,input().split())) for i in range(N)]

A.sort()
sm = 0
cnt = 0

i = 0
while sm != M:
	cnt += A[i][0]*min(A[i][1],M-sm)
	sm += min(A[i][1],M-sm)
	i += 1

print(cnt)