# For taking integer inputs.
import math
from decimal import Decimal
from itertools import permutations


def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


n, m = invr()
A = []
for i in range(n):
    A.append(inlist())

A = sorted(A, key=lambda d: d[0])
res = 0
for a in A:
    if m == 0:
        break
    if a[1] >= m:
        res += a[0] * m
        m = 0
    else:
        res += a[0] * a[1]
        m -= a[1]
print(res) import math math from decimal import Decimal from itertools import permutations def inp():
    return(int(input()))


# For taking List inputs. inp return(int(input())) int(input()) int input() input def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable. inlist return(list(map(int, input().split()))) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs. instr s = input() s input() input return(list(s[:len(s)])) list(s[:len(s)]) list s[:len(s)] s :len(s) len(s) len s def invr():
    return(map(int, input().split())) invr return(map(int, input().split())) map(int, input().split()) map int input().split() ().split () input split n, m = invr() n invr() invr m A = [] A [] for i in range(n):
    A.append(inlist()) i range(n) range n A.append(inlist()) A.append A append inlist() inlist A = sorted(A, key=lambda d: d[0]) A sorted(A, key=lambda d: d[0]) sorted A key=lambda d: d[0] key lambda d: d[0] d[0] d 0 d res = 0 res 0 for a in A:
    if m == 0:
        break
    if a[1] >= m:
        res += a[0] * m
        m = 0
    else:
        res += a[0] * a[1]
        m -= a[1] a A if m == 0:
        break
     m == 0 m 0 break if a[1] >= m:
        res += a[0] * m
        m = 0
    else:
        res += a[0] * a[1]
        m -= a[1] a[1] >= m a[1] a 1 m res += a[0] * m res a[0] * m a[0] a 0 m m = 0 m 0 res += a[0] * a[1] res a[0] * a[1] a[0] a 0 a[1] a 1 m -= a[1] m a[1] a 1 print(res) print res res += a[0] * m a[0] * m res res = 0 0 res n, m = invr() invr() n def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable. def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable. inlist def invr():
    return(map(int, input().split())) def invr():
    return(map(int, input().split())) invr A = [] [] A res += a[0] * a[1] a[0] * a[1] res m -= a[1] a[1] m def inp():
    return(int(input()))


# For taking List inputs. def inp():
    return(int(input()))


# For taking List inputs. inp m = 0 0 m A = sorted(A, key=lambda d: d[0]) sorted(A, key=lambda d: d[0]) A def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs. def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs. instr m = invr() invr() m
# For taking integer inputs.
import math
from decimal import Decimal
from itertools import permutations


def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


n, m = invr()
A = []
for i in range(n):
    A.append(inlist())

A = sorted(A, key=lambda d: d[0])
res = 0
for a in A:
    if m == 0:
        break
    if a[1] >= m:
        res += a[0] * m
        m = 0
    else:
        res += a[0] * a[1]
        m -= a[1]
print(res)
