#coding: utf-8

import numpy as np

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

AB = np.array([list(map(int, input().split())) for _ in range(N)])

money = 0

col_num = 0

AB = AB[np.argsort(AB[:, col_num])]

if M <= AB[np.argmin(AB[:, 0]), 1]:

    money += AB[0, 0] * M

else:

    i = 0

    while M > 0:

        money += AB[i, 0] * AB[i, 1]

        M -= AB[i, 1]

        if M <= 0:

          money += AB[i, 0] * M

        i += 1

print(money)
N, M = list(map(int, input().split()))

AB = [list(map(int, input().split())) for _ in range(N)]

money = 0

AB = sorted(AB, key=lambda x: x[0])

if M <= AB[0][1]:

  money += AB[0][0] * M

else:

  i = 0

  while M > 0:

    money += AB[i][0] * AB[i][1]

    M -= AB[i][1]

    if M <= 0:

      money += AB[i][0] * M

      break

    i += 1

print(money)
# coding: utf-8
import numpy as np

N, M = list(map(int, input().split()))
AB = np.array([list(map(int, input().split())) for _ in range(N)])
money = 0
col_num = 0
AB = AB[np.argsort(AB[:, col_num])]
if M <= AB[np.argmin(AB[:, 0]), 1]:
    money += AB[0, 0] * M
else:
    i = 0
    while M > 0:
        money += AB[i, 0] * AB[i, 1]
        M -= AB[i, 1]
        if M <= 0:
            money += AB[i, 0] * M
        i += 1
print(money)

N, M = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(N)]
money = 0
AB = sorted(AB, key=lambda x: x[0])
if M <= AB[0][1]:
    money += AB[0][0] * M
else:
    i = 0
    while M > 0:
        money += AB[i][0] * AB[i][1]
        M -= AB[i][1]
        if M <= 0:
            money += AB[i][0] * M
            break
        i += 1
print(money)

-# coding: utf-8 -import numpy as np - -AB = np.array([list(map(int, input().split())) for _ in range(N)]) +AB = [list(map(int, input().split())) for _ in range(N)] -col_num = 0 -AB = AB[np.argsort(AB[:, col_num])] -if M <= AB[np.argmin(AB[:, 0]), 1]: -    money += AB[0, 0] * M +AB = sorted(AB, key=lambda x: x[0]) +if M <= AB[0][1]: +    money += AB[0][0] * M -        money += AB[i, 0] * AB[i, 1] -        M -= AB[i, 1] +        money += AB[i][0] * AB[i][1] +        M -= AB[i][1] -            money += AB[i, 0] * M +            money += AB[i][0] * M +            break