from functools import reduce

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

A, B = list(zip(*sorted((list(map(int, input().split())) for _ in range(N)))))

ans = reduce(lambda acc, t: (acc[0] + t[0] * min(max(0, M - acc[1]), t[1]), acc[1] + t[1]), list(zip(A, B)), (0, 0))[0]

print(ans)

from functools import reduce

# 入力

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

A, B = list(zip(*(list(map(int, input().split())) for _ in range(N))))



# 1本あたりの値段が安い店から順に購入

ans = reduce(

    lambda acc, t: (

        acc[0] + t[0] * min(t[1], M - acc[1]),

        acc[1] + t[1]

    ) if acc[1] < M else

    acc,

    sorted(zip(A, B)),

    (0, 0)

)[0]



# 出力

print(ans)

from functools import reduce

N, M = list(map(int, input().split()))
A, B = list(zip(*sorted((list(map(int, input().split())) for _ in range(N)))))
ans = reduce(
    lambda acc, t: (acc[0] + t[0] * min(max(0, M - acc[1]), t[1]), acc[1] + t[1]),
    list(zip(A, B)),
    (0, 0),
)[0]
print(ans)

from functools import reduce

# 入力
N, M = list(map(int, input().split()))
A, B = list(zip(*(list(map(int, input().split())) for _ in range(N))))
# 1本あたりの値段が安い店から順に購入
ans = reduce(
    lambda acc, t: (acc[0] + t[0] * min(t[1], M - acc[1]), acc[1] + t[1])
    if acc[1] < M
    else acc,
    sorted(zip(A, B)),
    (0, 0),
)[0]
# 出力
print(ans)

+# 入力 -A, B = list(zip(*sorted((list(map(int, input().split())) for _ in range(N))))) +A, B = list(zip(*(list(map(int, input().split())) for _ in range(N)))) +# 1本あたりの値段が安い店から順に購入 -    lambda acc, t: (acc[0] + t[0] * min(max(0, M - acc[1]), t[1]), acc[1] + t[1]), -    list(zip(A, B)), +    lambda acc, t: (acc[0] + t[0] * min(t[1], M - acc[1]), acc[1] + t[1]) +    if acc[1] < M +    else acc, +    sorted(zip(A, B)), +# 出力