import numpy as np
N,M = (int(X) for X in input().split())
Shop = np.zeros((N,2),dtype=int)
for T in range(0,N):
    Shop[T,:] = (np.array([int(X) for X in input().split()]))
Shop = Shop[np.argsort(Shop[:,0])]
Rest = M
Pric = 0
for T in range(0,N):
    Pric += Shop[T,0]*Shop[T,1]
    Rest -= Shop[T,1]
    if Rest<0:
        Pric += Rest*Shop[T,0]
        break
print(Pric) import numpy as np numpy int(X) for X in input().split() for X in input().split() X input().split() ().split () input split for X in input().split() int(X) int X N,M = (int(X) for X in input().split()) N (int(X) for X in input().split()) M Shop = np.zeros((N,2),dtype=int) Shop np.zeros((N,2),dtype=int) np.zeros np zeros (N,2) N 2 dtype=int dtype int for T in range(0,N):
    Shop[T,:] = (np.array([int(X) for X in input().split()])) T range(0,N) range 0 N int(X) for X in input().split() for X in input().split() X input().split() ().split () input split for X in input().split() int(X) int X Shop[T,:] = (np.array([int(X) for X in input().split()])) Shop[T,:] Shop T np.array([int(X) for X in input().split()]) np.array np array [int(X) for X in input().split()] Shop = Shop[np.argsort(Shop[:,0])] Shop Shop[np.argsort(Shop[:,0])] Shop np.argsort(Shop[:,0]) np.argsort np argsort Shop[:,0] Shop : Rest = M Rest M Pric = 0 Pric 0 for T in range(0,N):
    Pric += Shop[T,0]*Shop[T,1]
    Rest -= Shop[T,1]
    if Rest<0:
        Pric += Rest*Shop[T,0]
        break T range(0,N) range 0 N Pric += Shop[T,0]*Shop[T,1] Pric Shop[T,0]*Shop[T,1] Shop[T,0] Shop T Shop[T,1] Shop T Rest -= Shop[T,1] Rest Shop[T,1] Shop T if Rest<0:
        Pric += Rest*Shop[T,0]
        break Rest<0 Rest 0 Pric += Rest*Shop[T,0] Pric Rest*Shop[T,0] Rest Shop[T,0] Shop T break print(Pric) print Pric Shop = Shop[np.argsort(Shop[:,0])] Shop[np.argsort(Shop[:,0])] Shop Pric += Rest*Shop[T,0] Rest*Shop[T,0] Pric Shop = np.zeros((N,2),dtype=int) np.zeros((N,2),dtype=int) Shop N,M = (int(X) for X in input().split()) (int(X) for X in input().split()) N Rest = M M Rest Pric = 0 0 Pric Rest -= Shop[T,1] Shop[T,1] Rest M = (int(X) for X in input().split()) (int(X) for X in input().split()) M Pric += Shop[T,0]*Shop[T,1] Shop[T,0]*Shop[T,1] Pric
import numpy as np
N,M = (int(X) for X in input().split())
Shop = np.zeros((N,2),dtype=int)
for T in range(0,N):
    Shop[T,:] = (np.array([int(X) for X in input().split()]))
Shop = Shop[np.argsort(Shop[:,0])]
Rest = M
Pric = 0
for T in range(0,N):
    Pric += Shop[T,0]*Shop[T,1]
    Rest -= Shop[T,1]
    if Rest<0:
        Pric += Rest*Shop[T,0]
        break
print(Pric)