n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
a = sorted(a, key=lambda x:x[0])
money = 0
drink = 0
for i in range(n):
  for j in range(a[i][1]):
    drink += 1
    money += a[i][0]
    if drink == m:
      print(money)
      exit() 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 a = [list(map(int, input().split())) for i in range(n)] a [list(map(int, input().split())) for i in range(n)] a = sorted(a, key=lambda x:x[0]) a sorted(a, key=lambda x:x[0]) sorted a key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x money = 0 money 0 drink = 0 drink 0 for i in range(n):
  for j in range(a[i][1]):
    drink += 1
    money += a[i][0]
    if drink == m:
      print(money)
      exit() i range(n) range n for j in range(a[i][1]):
    drink += 1
    money += a[i][0]
    if drink == m:
      print(money)
      exit() j range(a[i][1]) range a[i][1] [i] a i 1 drink += 1 drink 1 money += a[i][0] money a[i][0] [i] a i 0 if drink == m:
      print(money)
      exit() drink == m drink m print(money) print money exit() exit a = [list(map(int, input().split())) for i in range(n)] [list(map(int, input().split())) for i in range(n)] a drink += 1 1 drink n, m = map(int, input().split()) map(int, input().split()) n m = map(int, input().split()) map(int, input().split()) m money += a[i][0] a[i][0] money a = sorted(a, key=lambda x:x[0]) sorted(a, key=lambda x:x[0]) a money = 0 0 money drink = 0 0 drink
n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
a = sorted(a, key=lambda x:x[0])
money = 0
drink = 0
for i in range(n):
  for j in range(a[i][1]):
    drink += 1
    money += a[i][0]
    if drink == m:
      print(money)
      exit()