n,m = map(int, input().split())
l = list()
for i in range(n):
  a,b = map(int, input().split())
  l.append([a,b])
l.sort()
money = 0
for i in range(n):
  x = l[i][1]
  if m > x:
    m -= x
    money += l[i][0]*x
  else:
    money += l[i][0] * m
    break
print(money) n,m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m l = list() l list() list for i in range(n):
  a,b = map(int, input().split())
  l.append([a,b]) i range(n) range n a,b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b l.append([a,b]) l.append l append [a,b] a b l.sort() l.sort l sort money = 0 money 0 for i in range(n):
  x = l[i][1]
  if m > x:
    m -= x
    money += l[i][0]*x
  else:
    money += l[i][0] * m
    break i range(n) range n x = l[i][1] x l[i][1] [i] l i 1 if m > x:
    m -= x
    money += l[i][0]*x
  else:
    money += l[i][0] * m
    break m > x m x m -= x m x money += l[i][0]*x money l[i][0]*x l[i][0] [i] l i 0 x money += l[i][0] * m money l[i][0] * m l[i][0] [i] l i 0 m break print(money) print money m = map(int, input().split()) map(int, input().split()) m money += l[i][0]*x l[i][0]*x money a,b = map(int, input().split()) map(int, input().split()) a n,m = map(int, input().split()) map(int, input().split()) n m -= x x m b = map(int, input().split()) map(int, input().split()) b money = 0 0 money x = l[i][1] l[i][1] x l = list() list() l money += l[i][0] * m l[i][0] * m money
n,m = map(int, input().split())
l = list()
for i in range(n):
  a,b = map(int, input().split())
  l.append([a,b])
l.sort()
money = 0
for i in range(n):
  x = l[i][1]
  if m > x:
    m -= x
    money += l[i][0]*x
  else:
    money += l[i][0] * m
    break
print(money)