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

cnt = 0
cost = 0
for a, b in AB:
    if M >= cnt:
        cnt += b
        cost += a*b
        if cnt == M:
            print(cost)
            break
        elif cnt > M:
            cost += (M-cnt)*a
            print(cost)
            break 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 AB = [list(map(int, input().split())) for _ in range(N)] AB [list(map(int, input().split())) for _ in range(N)] AB.sort(key=lambda x:x[0]) AB.sort AB sort key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x cnt = 0 cnt 0 cost = 0 cost 0 for a, b in AB:
    if M >= cnt:
        cnt += b
        cost += a*b
        if cnt == M:
            print(cost)
            break
        elif cnt > M:
            cost += (M-cnt)*a
            print(cost)
            break a b AB if M >= cnt:
        cnt += b
        cost += a*b
        if cnt == M:
            print(cost)
            break
        elif cnt > M:
            cost += (M-cnt)*a
            print(cost)
            break M >= cnt M cnt cnt += b cnt b cost += a*b cost a*b a b if cnt == M:
            print(cost)
            break
        elif cnt > M:
            cost += (M-cnt)*a
            print(cost)
            break cnt == M cnt M print(cost) print cost break elif cnt > M:
            cost += (M-cnt)*a
            print(cost)
            break cnt > M cnt M cost += (M-cnt)*a cost (M-cnt)*a M-cnt M cnt a print(cost) print cost break N, M = map(int, input().split()) map(int, input().split()) N AB = [list(map(int, input().split())) for _ in range(N)] [list(map(int, input().split())) for _ in range(N)] AB cnt += b b cnt M = map(int, input().split()) map(int, input().split()) M cnt = 0 0 cnt cost += (M-cnt)*a (M-cnt)*a cost cost += a*b a*b cost cost = 0 0 cost
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
AB.sort(key=lambda x:x[0])

cnt = 0
cost = 0
for a, b in AB:
    if M >= cnt:
        cnt += b
        cost += a*b
        if cnt == M:
            print(cost)
            break
        elif cnt > M:
            cost += (M-cnt)*a
            print(cost)
            break