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