n, m = map(int, input().split())
ab = []
for i in range(n):
    AB = list(map(int, input().split()))
    ab.append(AB)
x = 0
val = 0
ab.sort(key=lambda x:x[0])
for i in range(n):
    x += ab[i][1]
    val += ab[i][0]*ab[i][1]
    if x < m:
        continue
    else:
        val = val - ab[i][0]*(x - m)
        break
print(val) n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m ab = [] ab [] for i in range(n):
    AB = list(map(int, input().split()))
    ab.append(AB) i range(n) range n AB = list(map(int, input().split())) AB list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ab.append(AB) ab.append ab append AB x = 0 x 0 val = 0 val 0 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 for i in range(n):
    x += ab[i][1]
    val += ab[i][0]*ab[i][1]
    if x < m:
        continue
    else:
        val = val - ab[i][0]*(x - m)
        break i range(n) range n x += ab[i][1] x ab[i][1] [i] ab i 1 val += ab[i][0]*ab[i][1] val ab[i][0]*ab[i][1] ab[i][0] [i] ab i 0 ab[i][1] [i] ab i 1 if x < m:
        continue
    else:
        val = val - ab[i][0]*(x - m)
        break x < m x m continue val = val - ab[i][0]*(x - m) val val - ab[i][0]*(x - m) val ab[i][0]*(x - m) ab[i][0] [i] ab i 0 x - m x m break print(val) print val x += ab[i][1] ab[i][1] x val += ab[i][0]*ab[i][1] ab[i][0]*ab[i][1] val ab = [] [] ab val = 0 0 val AB = list(map(int, input().split())) list(map(int, input().split())) AB x = 0 0 x m = map(int, input().split()) map(int, input().split()) m val = val - ab[i][0]*(x - m) val - ab[i][0]*(x - m) val n, m = map(int, input().split()) map(int, input().split()) n
n, m = map(int, input().split())
ab = []
for i in range(n):
    AB = list(map(int, input().split()))
    ab.append(AB)
x = 0
val = 0
ab.sort(key=lambda x:x[0])
for i in range(n):
    x += ab[i][1]
    val += ab[i][0]*ab[i][1]
    if x < m:
        continue
    else:
        val = val - ab[i][0]*(x - m)
        break
print(val)