import sys

input = sys.stdin.readline
n, m = map(int, input().split())
dict1 = {}
for _ in range(n):
    price, b = map(int, input().split())
    if price in dict1:
        dict1[price] += b
    else:
        dict1[price] = b

money_cnt = 0
for price, b in sorted(dict1.items()):
    if b < m:
        m -= b
        money_cnt += price * b
    else:
        money_cnt += price * m
        break
print(money_cnt) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m dict1 = {} dict1 {} for _ in range(n):
    price, b = map(int, input().split())
    if price in dict1:
        dict1[price] += b
    else:
        dict1[price] = b _ range(n) range n price, b = map(int, input().split()) price map(int, input().split()) map int input().split() ().split () input split b if price in dict1:
        dict1[price] += b
    else:
        dict1[price] = b price in dict1 price dict1 dict1[price] += b dict1[price] dict1 price b dict1[price] = b dict1[price] dict1 price b money_cnt = 0 money_cnt 0 for price, b in sorted(dict1.items()):
    if b < m:
        m -= b
        money_cnt += price * b
    else:
        money_cnt += price * m
        break price b sorted(dict1.items()) sorted dict1.items() dict1.items dict1 items if b < m:
        m -= b
        money_cnt += price * b
    else:
        money_cnt += price * m
        break b < m b m m -= b m b money_cnt += price * b money_cnt price * b price b money_cnt += price * m money_cnt price * m price m break print(money_cnt) print money_cnt dict1 = {} {} dict1 n, m = map(int, input().split()) map(int, input().split()) n m = map(int, input().split()) map(int, input().split()) m input = sys.stdin.readline sys.stdin.readline input price, b = map(int, input().split()) map(int, input().split()) price money_cnt += price * b price * b money_cnt money_cnt += price * m price * m money_cnt b = map(int, input().split()) map(int, input().split()) b money_cnt = 0 0 money_cnt m -= b b m
import sys

input = sys.stdin.readline
n, m = map(int, input().split())
dict1 = {}
for _ in range(n):
    price, b = map(int, input().split())
    if price in dict1:
        dict1[price] += b
    else:
        dict1[price] = b

money_cnt = 0
for price, b in sorted(dict1.items()):
    if b < m:
        m -= b
        money_cnt += price * b
    else:
        money_cnt += price * m
        break
print(money_cnt)