        
    
N, M = map(int, input().split())

AB = []
for _ in range(N):
    A, B = map(int, input().split())
    AB.append([A, B])

AB.sort()

gelt = 0
drink = 0
for i in range(len(AB)):
    if drink + AB[i][1] <= M:
        drink += AB[i][1]
        gelt += AB[i][0] * AB[i][1]
    else:
        gelt += (M - drink) * AB[i][0]
        break
        
print(gelt) N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M AB = [] AB [] for _ in range(N):
    A, B = map(int, input().split())
    AB.append([A, B]) _ range(N) range N A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B AB.append([A, B]) AB.append AB append [A, B] A B AB.sort() AB.sort AB sort gelt = 0 gelt 0 drink = 0 drink 0 for i in range(len(AB)):
    if drink + AB[i][1] <= M:
        drink += AB[i][1]
        gelt += AB[i][0] * AB[i][1]
    else:
        gelt += (M - drink) * AB[i][0]
        break
         i range(len(AB)) range len(AB) len AB if drink + AB[i][1] <= M:
        drink += AB[i][1]
        gelt += AB[i][0] * AB[i][1]
    else:
        gelt += (M - drink) * AB[i][0]
        break
         drink + AB[i][1] <= M drink + AB[i][1] drink AB[i][1] [i] AB i 1 M drink += AB[i][1] drink AB[i][1] [i] AB i 1 gelt += AB[i][0] * AB[i][1] gelt AB[i][0] * AB[i][1] AB[i][0] [i] AB i 0 AB[i][1] [i] AB i 1 gelt += (M - drink) * AB[i][0] gelt (M - drink) * AB[i][0] M - drink M drink AB[i][0] [i] AB i 0 break print(gelt) print gelt B = map(int, input().split()) map(int, input().split()) B gelt += (M - drink) * AB[i][0] (M - drink) * AB[i][0] gelt M = map(int, input().split()) map(int, input().split()) M drink += AB[i][1] AB[i][1] drink gelt += AB[i][0] * AB[i][1] AB[i][0] * AB[i][1] gelt drink = 0 0 drink AB = [] [] AB A, B = map(int, input().split()) map(int, input().split()) A gelt = 0 0 gelt N, M = map(int, input().split()) map(int, input().split()) N
        
    
N, M = map(int, input().split())

AB = []
for _ in range(N):
    A, B = map(int, input().split())
    AB.append([A, B])

AB.sort()

gelt = 0
drink = 0
for i in range(len(AB)):
    if drink + AB[i][1] <= M:
        drink += AB[i][1]
        gelt += AB[i][0] * AB[i][1]
    else:
        gelt += (M - drink) * AB[i][0]
        break
        
print(gelt)