n,m = map(int, input().split())

ab = [list(map(int, input().split())) for i in range(n)]

ab.sort()

payment = 0

for i in ab:
  price = i[0]
  amount = i[1]
  if amount > m:
    amount = m
  m -= amount
  payment += amount*price
  if m == 0:
    break

print(payment)  n,m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m list(map(int, input().split())) for i in range(n) for i in range(n) i range(n) range n for i in range(n) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ab = [list(map(int, input().split())) for i in range(n)] ab [list(map(int, input().split())) for i in range(n)] ab.sort() ab.sort ab sort payment = 0 payment 0 for i in ab:
  price = i[0]
  amount = i[1]
  if amount > m:
    amount = m
  m -= amount
  payment += amount*price
  if m == 0:
    break i ab price = i[0] price i[0] i 0 amount = i[1] amount i[1] i 1 if amount > m:
    amount = m
   amount > m amount m amount = m amount m m -= amount m amount payment += amount*price payment amount*price amount price if m == 0:
    break m == 0 m 0 break print(payment) print payment n,m = map(int, input().split()) map(int, input().split()) n payment = 0 0 payment m -= amount amount m ab = [list(map(int, input().split())) for i in range(n)] [list(map(int, input().split())) for i in range(n)] ab m = map(int, input().split()) map(int, input().split()) m price = i[0] i[0] price amount = m m amount payment += amount*price amount*price payment amount = i[1] i[1] amount
n,m = map(int, input().split())

ab = [list(map(int, input().split())) for i in range(n)]

ab.sort()

payment = 0

for i in ab:
  price = i[0]
  amount = i[1]
  if amount > m:
    amount = m
  m -= amount
  payment += amount*price
  if m == 0:
    break

print(payment) 