a = list(map(int,input().split()))
b = []
ans = 0
cnt = a[1]
for i in range(a[0]):
  c = list(map(int,input().split()))
  b.append(c)
b = sorted(b)
for i in b:
  if cnt == 0:
    break
  ans += i[0]*min(cnt,i[1])
  cnt -= min(cnt,i[1])
print(ans)
    
  
  
 a = list(map(int,input().split())) a list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split b = [] b [] ans = 0 ans 0 cnt = a[1] cnt a[1] a 1 for i in range(a[0]):
  c = list(map(int,input().split()))
  b.append(c) i range(a[0]) range a[0] a 0 c = list(map(int,input().split())) c list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split b.append(c) b.append b append c b = sorted(b) b sorted(b) sorted b for i in b:
  if cnt == 0:
    break
  ans += i[0]*min(cnt,i[1])
  cnt -= min(cnt,i[1]) i b if cnt == 0:
    break
   cnt == 0 cnt 0 break ans += i[0]*min(cnt,i[1]) ans i[0]*min(cnt,i[1]) i[0] i 0 min(cnt,i[1]) min cnt i[1] i 1 cnt -= min(cnt,i[1]) cnt min(cnt,i[1]) min cnt i[1] i 1 print(ans) print ans b = sorted(b) sorted(b) b cnt -= min(cnt,i[1]) min(cnt,i[1]) cnt b = [] [] b a = list(map(int,input().split())) list(map(int,input().split())) a c = list(map(int,input().split())) list(map(int,input().split())) c cnt = a[1] a[1] cnt ans = 0 0 ans ans += i[0]*min(cnt,i[1]) i[0]*min(cnt,i[1]) ans
a = list(map(int,input().split()))
b = []
ans = 0
cnt = a[1]
for i in range(a[0]):
  c = list(map(int,input().split()))
  b.append(c)
b = sorted(b)
for i in b:
  if cnt == 0:
    break
  ans += i[0]*min(cnt,i[1])
  cnt -= min(cnt,i[1])
print(ans)
    
  
  

