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

drinks = sorted(tuple(map(int, input().split())) for _ in range(N))

ans = 0

for A, B in drinks:

    if M > B:

        ans += A * B

        M -= B

    else:

        ans += A * M

        break

print(ans)

import sys





def input():

    return sys.stdin.readline().strip()





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

drinks = sorted(tuple(map(int, input().split())) for _ in range(N))

ans = 0

for A, B in drinks:

    if M > B:

        ans += A * B

        M -= B

    else:

        ans += A * M

        break

print(ans)

N, M = list(map(int, input().split()))
drinks = sorted(tuple(map(int, input().split())) for _ in range(N))
ans = 0
for A, B in drinks:
    if M > B:
        ans += A * B
        M -= B
    else:
        ans += A * M
        break
print(ans)

import sys


def input():
    return sys.stdin.readline().strip()


N, M = list(map(int, input().split()))
drinks = sorted(tuple(map(int, input().split())) for _ in range(N))
ans = 0
for A, B in drinks:
    if M > B:
        ans += A * B
        M -= B
    else:
        ans += A * M
        break
print(ans)

+import sys + + +def input(): +    return sys.stdin.readline().strip() + +