N, M = map(int, input().split())
arr = sorted([list(map(int, input().split())) for _ in range(N)])

count = 0
money = 0
for list in arr:
    for i in range(list[1]):
        money += list[0]
        count += 1
        if count == M:
            print(money)
            exit()


 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 arr = sorted([list(map(int, input().split())) for _ in range(N)]) arr sorted([list(map(int, input().split())) for _ in range(N)]) sorted [list(map(int, input().split())) for _ in range(N)] count = 0 count 0 money = 0 money 0 for list in arr:
    for i in range(list[1]):
        money += list[0]
        count += 1
        if count == M:
            print(money)
            exit() list arr for i in range(list[1]):
        money += list[0]
        count += 1
        if count == M:
            print(money)
            exit() i range(list[1]) range list[1] list 1 money += list[0] money list[0] list 0 count += 1 count 1 if count == M:
            print(money)
            exit() count == M count M print(money) print money exit() exit money = 0 0 money count = 0 0 count arr = sorted([list(map(int, input().split())) for _ in range(N)]) sorted([list(map(int, input().split())) for _ in range(N)]) arr money += list[0] list[0] money count += 1 1 count N, M = map(int, input().split()) map(int, input().split()) N M = map(int, input().split()) map(int, input().split()) M
N, M = map(int, input().split())
arr = sorted([list(map(int, input().split())) for _ in range(N)])

count = 0
money = 0
for list in arr:
    for i in range(list[1]):
        money += list[0]
        count += 1
        if count == M:
            print(money)
            exit()



