f=lambda:[*map(int,input().split())]
n,m=f()
p=sorted((f()) for _ in range(n))
c=0
for a,b in p:
  if m>b:
    c+=a*b
    m-=b
  else:
    c+=a*m
    break
print(c) f=lambda:[*map(int,input().split())] f lambda:[*map(int,input().split())] [*map(int,input().split())] *map(int,input().split()) map(int,input().split()) map int input().split() ().split () input split n,m=f() n f() f m p=sorted((f()) for _ in range(n)) p sorted((f()) for _ in range(n)) sorted f() f c=0 c 0 for a,b in p:
  if m>b:
    c+=a*b
    m-=b
  else:
    c+=a*m
    break a b p if m>b:
    c+=a*b
    m-=b
  else:
    c+=a*m
    break m>b m b c+=a*b c a*b a b m-=b m b c+=a*m c a*m a m break print(c) print c n,m=f() f() n p=sorted((f()) for _ in range(n)) sorted((f()) for _ in range(n)) p m=f() f() m c=0 0 c c+=a*m a*m c c+=a*b a*b c f=lambda:[*map(int,input().split())] lambda:[*map(int,input().split())] f m-=b b m
f=lambda:[*map(int,input().split())]
n,m=f()
p=sorted((f()) for _ in range(n))
c=0
for a,b in p:
  if m>b:
    c+=a*b
    m-=b
  else:
    c+=a*m
    break
print(c)