def actual(N, M, AB):
    payment = 0

    shop_order_by_price_desc = sorted(AB, key=lambda x: x[0])

    for price, stock in shop_order_by_price_desc:
        if stock >= M:
            # 端数があるときは、残りの必要分だけ買えばよい
            return payment + (price * M)
        else:
            # 端数がないなら買い切る
            M -= stock
            payment += price * stock


N, M = map(int, input().split())
AB = []
for _ in range(N):
    a, b = map(int, input().split())
    AB.append([a, b])

print(actual(N, M, AB)) def actual(N, M, AB):
    payment = 0

    shop_order_by_price_desc = sorted(AB, key=lambda x: x[0])

    for price, stock in shop_order_by_price_desc:
        if stock >= M:
            # 端数があるときは、残りの必要分だけ買えばよい
            return payment + (price * M)
        else:
            # 端数がないなら買い切る
            M -= stock
            payment += price * stock actual payment = 0 payment 0 shop_order_by_price_desc = sorted(AB, key=lambda x: x[0]) shop_order_by_price_desc sorted(AB, key=lambda x: x[0]) sorted AB key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x for price, stock in shop_order_by_price_desc:
        if stock >= M:
            # 端数があるときは、残りの必要分だけ買えばよい
            return payment + (price * M)
        else:
            # 端数がないなら買い切る
            M -= stock
            payment += price * stock price stock shop_order_by_price_desc if stock >= M:
            # 端数があるときは、残りの必要分だけ買えばよい
            return payment + (price * M)
        else:
            # 端数がないなら買い切る
            M -= stock
            payment += price * stock stock >= M stock M return payment + (price * M) payment + (price * M) payment price * M price M M -= stock M stock payment += price * stock payment price * stock price stock N N M M AB AB N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M AB = [] AB [] for _ in range(N):
    a, b = map(int, input().split())
    AB.append([a, b]) _ range(N) range N a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b AB.append([a, b]) AB.append AB append [a, b] a b print(actual(N, M, AB)) print actual(N, M, AB) actual N M AB b = map(int, input().split()) map(int, input().split()) b N, M = map(int, input().split()) map(int, input().split()) N M = map(int, input().split()) map(int, input().split()) M AB = [] [] AB def actual(N, M, AB):
    payment = 0

    shop_order_by_price_desc = sorted(AB, key=lambda x: x[0])

    for price, stock in shop_order_by_price_desc:
        if stock >= M:
            # 端数があるときは、残りの必要分だけ買えばよい
            return payment + (price * M)
        else:
            # 端数がないなら買い切る
            M -= stock
            payment += price * stock def actual(N, M, AB):
    payment = 0

    shop_order_by_price_desc = sorted(AB, key=lambda x: x[0])

    for price, stock in shop_order_by_price_desc:
        if stock >= M:
            # 端数があるときは、残りの必要分だけ買えばよい
            return payment + (price * M)
        else:
            # 端数がないなら買い切る
            M -= stock
            payment += price * stock actual a, b = map(int, input().split()) map(int, input().split()) a
def actual(N, M, AB):
    payment = 0

    shop_order_by_price_desc = sorted(AB, key=lambda x: x[0])

    for price, stock in shop_order_by_price_desc:
        if stock >= M:
            # 端数があるときは、残りの必要分だけ買えばよい
            return payment + (price * M)
        else:
            # 端数がないなら買い切る
            M -= stock
            payment += price * stock


N, M = map(int, input().split())
AB = []
for _ in range(N):
    a, b = map(int, input().split())
    AB.append([a, b])

print(actual(N, M, AB))
