n,m = map(int, input().split(" "))
a = sorted(list(map(int, input().split(" "))) for i in range(n))
total = 0
for i, j in a:
  if j < m:
    m -= j
    total += i * j
  else:
    total += i * m
    break
print(total) n,m = map(int, input().split(" ")) n map(int, input().split(" ")) map int input().split(" ") ().split () input split " " m a = sorted(list(map(int, input().split(" "))) for i in range(n)) a sorted(list(map(int, input().split(" "))) for i in range(n)) sorted list(map(int, input().split(" "))) list map(int, input().split(" ")) map int input().split(" ") ().split () input split " " total = 0 total 0 for i, j in a:
  if j < m:
    m -= j
    total += i * j
  else:
    total += i * m
    break i j a if j < m:
    m -= j
    total += i * j
  else:
    total += i * m
    break j < m j m m -= j m j total += i * j total i * j i j total += i * m total i * m i m break print(total) print total total += i * m i * m total total += i * j i * j total m = map(int, input().split(" ")) map(int, input().split(" ")) m total = 0 0 total n,m = map(int, input().split(" ")) map(int, input().split(" ")) n m -= j j m a = sorted(list(map(int, input().split(" "))) for i in range(n)) sorted(list(map(int, input().split(" "))) for i in range(n)) a
n,m = map(int, input().split(" "))
a = sorted(list(map(int, input().split(" "))) for i in range(n))
total = 0
for i, j in a:
  if j < m:
    m -= j
    total += i * j
  else:
    total += i * m
    break
print(total)