def resolve():
    N, M = map(int, input().split())

    shops = []
    for i in range(N):
        aa, bb = map(int, input().split())
        shops.append([aa, bb])

    shops.sort(key=lambda x: x[0])

    rem = M
    ans = 0
    for shop in shops:
        buy = min(rem, shop[1])
        ans += buy * shop[0]
        rem -= buy

    print(ans)


resolve() def resolve():
    N, M = map(int, input().split())

    shops = []
    for i in range(N):
        aa, bb = map(int, input().split())
        shops.append([aa, bb])

    shops.sort(key=lambda x: x[0])

    rem = M
    ans = 0
    for shop in shops:
        buy = min(rem, shop[1])
        ans += buy * shop[0]
        rem -= buy

    print(ans) resolve N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M shops = [] shops [] for i in range(N):
        aa, bb = map(int, input().split())
        shops.append([aa, bb])

     i range(N) range N aa, bb = map(int, input().split()) aa map(int, input().split()) map int input().split() ().split () input split bb shops.append([aa, bb]) shops.append shops append [aa, bb] aa bb shops.sort(key=lambda x: x[0]) shops.sort shops sort key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x rem = M rem M ans = 0 ans 0 for shop in shops:
        buy = min(rem, shop[1])
        ans += buy * shop[0]
        rem -= buy

     shop shops buy = min(rem, shop[1]) buy min(rem, shop[1]) min rem shop[1] shop 1 ans += buy * shop[0] ans buy * shop[0] buy shop[0] shop 0 rem -= buy rem buy print(ans) print ans resolve() resolve def resolve():
    N, M = map(int, input().split())

    shops = []
    for i in range(N):
        aa, bb = map(int, input().split())
        shops.append([aa, bb])

    shops.sort(key=lambda x: x[0])

    rem = M
    ans = 0
    for shop in shops:
        buy = min(rem, shop[1])
        ans += buy * shop[0]
        rem -= buy

    print(ans) def resolve():
    N, M = map(int, input().split())

    shops = []
    for i in range(N):
        aa, bb = map(int, input().split())
        shops.append([aa, bb])

    shops.sort(key=lambda x: x[0])

    rem = M
    ans = 0
    for shop in shops:
        buy = min(rem, shop[1])
        ans += buy * shop[0]
        rem -= buy

    print(ans) resolve
def resolve():
    N, M = map(int, input().split())

    shops = []
    for i in range(N):
        aa, bb = map(int, input().split())
        shops.append([aa, bb])

    shops.sort(key=lambda x: x[0])

    rem = M
    ans = 0
    for shop in shops:
        buy = min(rem, shop[1])
        ans += buy * shop[0]
        rem -= buy

    print(ans)


resolve()
