N, M = [int(x) for x in input().split()]

AB = [[int(x) for x in input().split()] for _ in range(N)]

PRICE = 0

NBOTTLE = 1



AB.sort() # price昇順でソート

bought = 0

paid = 0

for i in range(N):

    if bought >= M: break

    buy = min(M - bought, AB[i][NBOTTLE])

    bought += buy

    paid += buy * AB[i][PRICE]



print(paid)
import sys

input=sys.stdin.readline



N, M = [int(x) for x in input().split()]

AB = [[int(x) for x in input().split()] for _ in range(N)]

PRICE = 0

NBOTTLE = 1



AB.sort() # price昇順でソート

bought = 0

paid = 0

for i in range(N):

    if bought >= M: break

    buy = min(M - bought, AB[i][NBOTTLE])

    bought += buy

    paid += buy * AB[i][PRICE]



print(paid)

N, M = [int(x) for x in input().split()]
AB = [[int(x) for x in input().split()] for _ in range(N)]
PRICE = 0
NBOTTLE = 1
AB.sort()  # price昇順でソート
bought = 0
paid = 0
for i in range(N):
    if bought >= M:
        break
    buy = min(M - bought, AB[i][NBOTTLE])
    bought += buy
    paid += buy * AB[i][PRICE]
print(paid)

import sys

input = sys.stdin.readline
N, M = [int(x) for x in input().split()]
AB = [[int(x) for x in input().split()] for _ in range(N)]
PRICE = 0
NBOTTLE = 1
AB.sort()  # price昇順でソート
bought = 0
paid = 0
for i in range(N):
    if bought >= M:
        break
    buy = min(M - bought, AB[i][NBOTTLE])
    bought += buy
    paid += buy * AB[i][PRICE]
print(paid)

+import sys + +input = sys.stdin.readline