N,M=map(int,input().split())
L=sorted([tuple(map(int,input().split())) for i in range(N)])
ans=0
for a,b in L:
    if M>b:
        ans+=a*b
        M-=b
    else:
        ans+=a*M
        break
print(ans) N,M=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split M tuple(map(int,input().split())) for i in range(N) for i in range(N) i range(N) range N for i in range(N) tuple(map(int,input().split())) tuple map(int,input().split()) map int input().split() ().split () input split L=sorted([tuple(map(int,input().split())) for i in range(N)]) L sorted([tuple(map(int,input().split())) for i in range(N)]) sorted [tuple(map(int,input().split())) for i in range(N)] ans=0 ans 0 for a,b in L:
    if M>b:
        ans+=a*b
        M-=b
    else:
        ans+=a*M
        break a b L if M>b:
        ans+=a*b
        M-=b
    else:
        ans+=a*M
        break M>b M b ans+=a*b ans a*b a b M-=b M b ans+=a*M ans a*M a M break print(ans) print ans M=map(int,input().split()) map(int,input().split()) M M-=b b M ans=0 0 ans ans+=a*M a*M ans ans+=a*b a*b ans N,M=map(int,input().split()) map(int,input().split()) N L=sorted([tuple(map(int,input().split())) for i in range(N)]) sorted([tuple(map(int,input().split())) for i in range(N)]) L
N,M=map(int,input().split())
L=sorted([tuple(map(int,input().split())) for i in range(N)])
ans=0
for a,b in L:
    if M>b:
        ans+=a*b
        M-=b
    else:
        ans+=a*M
        break
print(ans)