n,m = map( int,input().split() )
a = [ list(map(int,input().split())) for _ in range(n)]

a.sort()

c = 0
for i in range(n):
  x = min(m,a[i][1])
  c += x * a[i][0]
  m -= x
  if m == 0 :
    break

print(c) 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 _ in range(n) for _ in range(n) _ range(n) range n for _ 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 _ in range(n)] a [ list(map(int,input().split())) for _ in range(n)] a.sort() a.sort a sort c = 0 c 0 for i in range(n):
  x = min(m,a[i][1])
  c += x * a[i][0]
  m -= x
  if m == 0 :
    break i range(n) range n x = min(m,a[i][1]) x min(m,a[i][1]) min m a[i][1] [i] a i 1 c += x * a[i][0] c x * a[i][0] x a[i][0] [i] a i 0 m -= x m x if m == 0 :
    break m == 0 m 0 break print(c) print c x = min(m,a[i][1]) min(m,a[i][1]) x a = [ list(map(int,input().split())) for _ in range(n)] [ list(map(int,input().split())) for _ in range(n)] a c = 0 0 c n,m = map( int,input().split() ) map( int,input().split() ) n m -= x x m c += x * a[i][0] x * a[i][0] c m = map( int,input().split() ) map( int,input().split() ) m
n,m = map( int,input().split() )
a = [ list(map(int,input().split())) for _ in range(n)]

a.sort()

c = 0
for i in range(n):
  x = min(m,a[i][1])
  c += x * a[i][0]
  m -= x
  if m == 0 :
    break

print(c)