n,m=map(int,input().split())
a=[]
for _ in range(n):
  b=list(map(int,input().split()))
  a.append(b)
  
a.sort(key=lambda x: x[0])
ans=0
h=0

for y in a:
  d=y[0]
  e=y[1]
  if h+e>m:
    ans+=(m-h)*d
    h+=(m-h)
  else:
    h+=e
    ans+=d*e

print(ans) n,m=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m a=[] a [] for _ in range(n):
  b=list(map(int,input().split()))
  a.append(b)
   _ range(n) range n b=list(map(int,input().split())) b list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split a.append(b) a.append a append b a.sort(key=lambda x: x[0]) a.sort a sort key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x ans=0 ans 0 h=0 h 0 for y in a:
  d=y[0]
  e=y[1]
  if h+e>m:
    ans+=(m-h)*d
    h+=(m-h)
  else:
    h+=e
    ans+=d*e y a d=y[0] d y[0] y 0 e=y[1] e y[1] y 1 if h+e>m:
    ans+=(m-h)*d
    h+=(m-h)
  else:
    h+=e
    ans+=d*e h+e>m h+e h e m ans+=(m-h)*d ans (m-h)*d m-h m h d h+=(m-h) h m-h m h h+=e h e ans+=d*e ans d*e d e print(ans) print ans h=0 0 h e=y[1] y[1] e n,m=map(int,input().split()) map(int,input().split()) n ans+=(m-h)*d (m-h)*d ans m=map(int,input().split()) map(int,input().split()) m d=y[0] y[0] d h+=e e h h+=(m-h) m-h h ans=0 0 ans ans+=d*e d*e ans b=list(map(int,input().split())) list(map(int,input().split())) b a=[] [] a
n,m=map(int,input().split())
a=[]
for _ in range(n):
  b=list(map(int,input().split()))
  a.append(b)
  
a.sort(key=lambda x: x[0])
ans=0
h=0

for y in a:
  d=y[0]
  e=y[1]
  if h+e>m:
    ans+=(m-h)*d
    h+=(m-h)
  else:
    h+=e
    ans+=d*e

print(ans)