n, m = map(int, input().split())
l = []
for i in range(n):
  a, b = map(int, input().split())
  l.append([a, b])

l.sort()
ans = 0
for i in range(n):
  if l[i][1] <= m:
    ans += l[i][0] * l[i][1]
    m -= l[i][1]
  else:
    ans += l[i][0] * m
    break
print(ans) n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m l = [] l [] 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 ans = 0 ans 0 for i in range(n):
  if l[i][1] <= m:
    ans += l[i][0] * l[i][1]
    m -= l[i][1]
  else:
    ans += l[i][0] * m
    break i range(n) range n if l[i][1] <= m:
    ans += l[i][0] * l[i][1]
    m -= l[i][1]
  else:
    ans += l[i][0] * m
    break l[i][1] <= m l[i][1] [i] l i 1 m ans += l[i][0] * l[i][1] ans l[i][0] * l[i][1] l[i][0] [i] l i 0 l[i][1] [i] l i 1 m -= l[i][1] m l[i][1] [i] l i 1 ans += l[i][0] * m ans l[i][0] * m l[i][0] [i] l i 0 m break print(ans) print ans a, b = map(int, input().split()) map(int, input().split()) a ans += l[i][0] * m l[i][0] * m ans ans = 0 0 ans m -= l[i][1] l[i][1] m ans += l[i][0] * l[i][1] l[i][0] * l[i][1] ans n, m = map(int, input().split()) map(int, input().split()) n m = map(int, input().split()) map(int, input().split()) m l = [] [] l b = map(int, input().split()) map(int, input().split()) b
n, m = map(int, input().split())
l = []
for i in range(n):
  a, b = map(int, input().split())
  l.append([a, b])

l.sort()
ans = 0
for i in range(n):
  if l[i][1] <= m:
    ans += l[i][0] * l[i][1]
    m -= l[i][1]
  else:
    ans += l[i][0] * m
    break
print(ans)