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

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

AB.sort()



res = 0

cnt = 0

for a, b in AB:

    tmp = M - cnt

    if tmp <= b:

        res += a * tmp

        break

    res += a * b

    cnt += b



print(res)

import sys



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

AB = [list(map(int, sys.stdin.readline().rsplit())) for _ in range(N)]



AB.sort()



res = 0

for a, b in AB:

    if M > b:

        M -= b

        res += a * b

    else:

        res += a * M

        break

print(res)

N, M = list(map(int, input().split()))
AB = [tuple(map(int, input().split())) for _ in range(N)]
AB.sort()
res = 0
cnt = 0
for a, b in AB:
    tmp = M - cnt
    if tmp <= b:
        res += a * tmp
        break
    res += a * b
    cnt += b
print(res)

import sys

N, M = list(map(int, input().split()))
AB = [list(map(int, sys.stdin.readline().rsplit())) for _ in range(N)]
AB.sort()
res = 0
for a, b in AB:
    if M > b:
        M -= b
        res += a * b
    else:
        res += a * M
        break
print(res)

+import sys + -AB = [tuple(map(int, input().split())) for _ in range(N)] +AB = [list(map(int, sys.stdin.readline().rsplit())) for _ in range(N)] -cnt = 0 -    tmp = M - cnt -    if tmp <= b: -        res += a * tmp +    if M > b: +        M -= b +        res += a * b +    else: +        res += a * M -    res += a * b -    cnt += b