from bisect import bisect_left
from itertools import accumulate

N, M = map(int, input().split())
shop = [list(map(int, input().split())) for _ in range(N)]
shop.sort(key=lambda x: x[0])

cnt = 0
ans = 0

for i in range(N):
    cnt += shop[i][1]
    if M <= cnt:
        dif = cnt - M
        ans += shop[i][0] * shop[i][1] - dif * shop[i][0]
        break
    else:
        ans += shop[i][0] * shop[i][1]

print(ans) from bisect import bisect_left from itertools import accumulate N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M list(map(int, input().split())) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split shop = [list(map(int, input().split())) for _ in range(N)] shop [list(map(int, input().split())) for _ in range(N)] shop.sort(key=lambda x: x[0]) shop.sort shop sort key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x cnt = 0 cnt 0 ans = 0 ans 0 for i in range(N):
    cnt += shop[i][1]
    if M <= cnt:
        dif = cnt - M
        ans += shop[i][0] * shop[i][1] - dif * shop[i][0]
        break
    else:
        ans += shop[i][0] * shop[i][1] i range(N) range N cnt += shop[i][1] cnt shop[i][1] [i] shop i 1 if M <= cnt:
        dif = cnt - M
        ans += shop[i][0] * shop[i][1] - dif * shop[i][0]
        break
    else:
        ans += shop[i][0] * shop[i][1] M <= cnt M cnt dif = cnt - M dif cnt - M cnt M ans += shop[i][0] * shop[i][1] - dif * shop[i][0] ans shop[i][0] * shop[i][1] - dif * shop[i][0] shop[i][0] * shop[i][1] shop[i][0] [i] shop i 0 shop[i][1] [i] shop i 1 dif * shop[i][0] dif shop[i][0] [i] shop i 0 break ans += shop[i][0] * shop[i][1] ans shop[i][0] * shop[i][1] shop[i][0] [i] shop i 0 shop[i][1] [i] shop i 1 print(ans) print ans N, M = map(int, input().split()) map(int, input().split()) N ans += shop[i][0] * shop[i][1] - dif * shop[i][0] shop[i][0] * shop[i][1] - dif * shop[i][0] ans cnt += shop[i][1] shop[i][1] cnt dif = cnt - M cnt - M dif ans = 0 0 ans shop = [list(map(int, input().split())) for _ in range(N)] [list(map(int, input().split())) for _ in range(N)] shop cnt = 0 0 cnt ans += shop[i][0] * shop[i][1] shop[i][0] * shop[i][1] ans M = map(int, input().split()) map(int, input().split()) M
from bisect import bisect_left
from itertools import accumulate

N, M = map(int, input().split())
shop = [list(map(int, input().split())) for _ in range(N)]
shop.sort(key=lambda x: x[0])

cnt = 0
ans = 0

for i in range(N):
    cnt += shop[i][1]
    if M <= cnt:
        dif = cnt - M
        ans += shop[i][0] * shop[i][1] - dif * shop[i][0]
        break
    else:
        ans += shop[i][0] * shop[i][1]

print(ans)