N,M=map(int,input().split())
l=sorted(list(tuple(map(int,input().split()))for i in range(N)),key=lambda x:x[0])
c=0
ans=0
for v,k in l:
    ans+=min(k,M-c)*v
    c+=min(k,M-c)
    if c==M:
        print(ans);exit() N,M=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split M l=sorted(list(tuple(map(int,input().split()))for i in range(N)),key=lambda x:x[0]) l sorted(list(tuple(map(int,input().split()))for i in range(N)),key=lambda x:x[0]) sorted list(tuple(map(int,input().split()))for i in range(N)) list tuple(map(int,input().split())) tuple map(int,input().split()) map int input().split() ().split () input split key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x c=0 c 0 ans=0 ans 0 for v,k in l:
    ans+=min(k,M-c)*v
    c+=min(k,M-c)
    if c==M:
        print(ans);exit() v k l ans+=min(k,M-c)*v ans min(k,M-c)*v min(k,M-c) min k M-c M c v c+=min(k,M-c) c min(k,M-c) min k M-c M c if c==M:
        print(ans);exit() c==M c M print(ans) print ans exit() exit ans+=min(k,M-c)*v min(k,M-c)*v ans c+=min(k,M-c) min(k,M-c) c N,M=map(int,input().split()) map(int,input().split()) N c=0 0 c ans=0 0 ans M=map(int,input().split()) map(int,input().split()) M l=sorted(list(tuple(map(int,input().split()))for i in range(N)),key=lambda x:x[0]) sorted(list(tuple(map(int,input().split()))for i in range(N)),key=lambda x:x[0]) l
N,M=map(int,input().split())
l=sorted(list(tuple(map(int,input().split()))for i in range(N)),key=lambda x:x[0])
c=0
ans=0
for v,k in l:
    ans+=min(k,M-c)*v
    c+=min(k,M-c)
    if c==M:
        print(ans);exit()
