N, M = [int(n) for n in input().split()]
A = []
for i in range(N):
    a, b = [int(n) for n in input().split()]
    A.append((a,b))
SA = sorted(A)
ans = 0
while True:
    sa = SA.pop(0)
    if sa[1] < M:
        ans += sa[0]*sa[1]
        M -= sa[1]
    else:
        ans += sa[0] * M
        break
print(ans) int(n) for n in input().split() for n in input().split() n input().split() ().split () input split for n in input().split() int(n) int n N, M = [int(n) for n in input().split()] N [int(n) for n in input().split()] M A = [] A [] for i in range(N):
    a, b = [int(n) for n in input().split()]
    A.append((a,b)) i range(N) range N int(n) for n in input().split() for n in input().split() n input().split() ().split () input split for n in input().split() int(n) int n a, b = [int(n) for n in input().split()] a [int(n) for n in input().split()] b A.append((a,b)) A.append A append (a,b) a b SA = sorted(A) SA sorted(A) sorted A ans = 0 ans 0 while True:
    sa = SA.pop(0)
    if sa[1] < M:
        ans += sa[0]*sa[1]
        M -= sa[1]
    else:
        ans += sa[0] * M
        break True sa = SA.pop(0) sa SA.pop(0) SA.pop SA pop 0 if sa[1] < M:
        ans += sa[0]*sa[1]
        M -= sa[1]
    else:
        ans += sa[0] * M
        break sa[1] < M sa[1] sa 1 M ans += sa[0]*sa[1] ans sa[0]*sa[1] sa[0] sa 0 sa[1] sa 1 M -= sa[1] M sa[1] sa 1 ans += sa[0] * M ans sa[0] * M sa[0] sa 0 M break print(ans) print ans a, b = [int(n) for n in input().split()] [int(n) for n in input().split()] a ans += sa[0]*sa[1] sa[0]*sa[1] ans N, M = [int(n) for n in input().split()] [int(n) for n in input().split()] N M = [int(n) for n in input().split()] [int(n) for n in input().split()] M ans += sa[0] * M sa[0] * M ans SA = sorted(A) sorted(A) SA ans = 0 0 ans sa = SA.pop(0) SA.pop(0) sa b = [int(n) for n in input().split()] [int(n) for n in input().split()] b M -= sa[1] sa[1] M A = [] [] A
N, M = [int(n) for n in input().split()]
A = []
for i in range(N):
    a, b = [int(n) for n in input().split()]
    A.append((a,b))
SA = sorted(A)
ans = 0
while True:
    sa = SA.pop(0)
    if sa[1] < M:
        ans += sa[0]*sa[1]
        M -= sa[1]
    else:
        ans += sa[0] * M
        break
print(ans)
