f=lambda:[*map(int,input().split())]
n,m=f()
c=0
for a,b in sorted((f()) for _ in range(n)):
  t=min(b,m)
  c+=a*t
  m-=t
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 c=0 c 0 for a,b in sorted((f()) for _ in range(n)):
  t=min(b,m)
  c+=a*t
  m-=t a b sorted((f()) for _ in range(n)) sorted f() f t=min(b,m) t min(b,m) min b m c+=a*t c a*t a t m-=t m t print(c) print c t=min(b,m) min(b,m) t c=0 0 c f=lambda:[*map(int,input().split())] lambda:[*map(int,input().split())] f n,m=f() f() n c+=a*t a*t c m-=t t m m=f() f() m
f=lambda:[*map(int,input().split())]
n,m=f()
c=0
for a,b in sorted((f()) for _ in range(n)):
  t=min(b,m)
  c+=a*t
  m-=t
print(c)