import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

N, M = inm()

prices = []
for i in range(N):
    a, b = inm()
    prices.append((a, b))
prices.sort()


def solve():
    cnt = 0
    amount = 0
    for a, b in prices:
        x = min(b, M - cnt)
        amount += x * a
        cnt += x
        if cnt >= M:
            break

    return amount


print(solve()) import sys sys sys.setrecursionlimit(10 ** 8) sys.setrecursionlimit sys setrecursionlimit 10 ** 8 10 8 ini = lambda: int(sys.stdin.readline()) ini lambda: int(sys.stdin.readline()) int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline inm = lambda: map(int, sys.stdin.readline().split()) inm lambda: map(int, sys.stdin.readline().split()) map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split inl = lambda: list(inm()) inl lambda: list(inm()) list(inm()) list inm() inm ins = lambda: sys.stdin.readline().rstrip() ins lambda: sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw)) debug lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw)) print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw)) print "\033[33m" *a a "\033[0m" **dict(file=sys.stderr, **kw) dict(file=sys.stderr, **kw) dict file=sys.stderr file sys.stderr sys stderr **kw kw *a **kw N, M = inm() N inm() inm M prices = [] prices [] for i in range(N):
    a, b = inm()
    prices.append((a, b)) i range(N) range N a, b = inm() a inm() inm b prices.append((a, b)) prices.append prices append (a, b) a b prices.sort() prices.sort prices sort def solve():
    cnt = 0
    amount = 0
    for a, b in prices:
        x = min(b, M - cnt)
        amount += x * a
        cnt += x
        if cnt >= M:
            break

    return amount solve cnt = 0 cnt 0 amount = 0 amount 0 for a, b in prices:
        x = min(b, M - cnt)
        amount += x * a
        cnt += x
        if cnt >= M:
            break

     a b prices x = min(b, M - cnt) x min(b, M - cnt) min b M - cnt M cnt amount += x * a amount x * a x a cnt += x cnt x if cnt >= M:
            break

     cnt >= M cnt M break return amount amount print(solve()) print solve() solve inm = lambda: map(int, sys.stdin.readline().split()) lambda: map(int, sys.stdin.readline().split()) inm ini = lambda: int(sys.stdin.readline()) lambda: int(sys.stdin.readline()) ini ins = lambda: sys.stdin.readline().rstrip() lambda: sys.stdin.readline().rstrip() ins prices = [] [] prices debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw)) lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw)) debug def solve():
    cnt = 0
    amount = 0
    for a, b in prices:
        x = min(b, M - cnt)
        amount += x * a
        cnt += x
        if cnt >= M:
            break

    return amount def solve():
    cnt = 0
    amount = 0
    for a, b in prices:
        x = min(b, M - cnt)
        amount += x * a
        cnt += x
        if cnt >= M:
            break

    return amount solve b = inm() inm() b N, M = inm() inm() N inl = lambda: list(inm()) lambda: list(inm()) inl a, b = inm() inm() a M = inm() inm() M
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

N, M = inm()

prices = []
for i in range(N):
    a, b = inm()
    prices.append((a, b))
prices.sort()


def solve():
    cnt = 0
    amount = 0
    for a, b in prices:
        x = min(b, M - cnt)
        amount += x * a
        cnt += x
        if cnt >= M:
            break

    return amount


print(solve())
