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