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