import numpy as np

N,M=map(int,input().split())
l=[]
for n in range(N):
    A,B=map(int,input().split())
    temp_l=[A,B]
    l.append(temp_l)
arr=np.array(l,dtype=np.int64)
# print(l)
# print(arr)

need=M
ans=0


col_num=0
# route=np.sort(arr,axis=0)  #numpyソートの仕方がおかしい
route=arr[np.argsort(arr[:,col_num])]
# print(route)
for i in range(N):
    if need >= route[i,1]:
        ans+=route[i,0]*route[i,1]
        need-=route[i,1]
        if need==0:
            break
        else:
            continue
    else:
        ans+=route[i,0]*need
        need=0
print(ans) import numpy as np numpy N,M=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split M l=[] l [] for n in range(N):
    A,B=map(int,input().split())
    temp_l=[A,B]
    l.append(temp_l) n range(N) range N A,B=map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split B temp_l=[A,B] temp_l [A,B] A B l.append(temp_l) l.append l append temp_l arr=np.array(l,dtype=np.int64) arr np.array(l,dtype=np.int64) np.array np array l dtype=np.int64 dtype np.int64 np int64 need=M need M ans=0 ans 0 col_num=0 col_num 0 route=arr[np.argsort(arr[:,col_num])] route arr[np.argsort(arr[:,col_num])] arr np.argsort(arr[:,col_num]) np.argsort np argsort arr[:,col_num] arr : for i in range(N):
    if need >= route[i,1]:
        ans+=route[i,0]*route[i,1]
        need-=route[i,1]
        if need==0:
            break
        else:
            continue
    else:
        ans+=route[i,0]*need
        need=0 i range(N) range N if need >= route[i,1]:
        ans+=route[i,0]*route[i,1]
        need-=route[i,1]
        if need==0:
            break
        else:
            continue
    else:
        ans+=route[i,0]*need
        need=0 need >= route[i,1] need route[i,1] route i ans+=route[i,0]*route[i,1] ans route[i,0]*route[i,1] route[i,0] route i route[i,1] route i need-=route[i,1] need route[i,1] route i if need==0:
            break
        else:
            continue
     need==0 need 0 break continue ans+=route[i,0]*need ans route[i,0]*need route[i,0] route i need need=0 need 0 print(ans) print ans l=[] [] l ans=0 0 ans need=0 0 need col_num=0 0 col_num need-=route[i,1] route[i,1] need ans+=route[i,0]*need route[i,0]*need ans arr=np.array(l,dtype=np.int64) np.array(l,dtype=np.int64) arr N,M=map(int,input().split()) map(int,input().split()) N route=arr[np.argsort(arr[:,col_num])] arr[np.argsort(arr[:,col_num])] route temp_l=[A,B] [A,B] temp_l M=map(int,input().split()) map(int,input().split()) M A,B=map(int,input().split()) map(int,input().split()) A ans+=route[i,0]*route[i,1] route[i,0]*route[i,1] ans B=map(int,input().split()) map(int,input().split()) B need=M M need
import numpy as np

N,M=map(int,input().split())
l=[]
for n in range(N):
    A,B=map(int,input().split())
    temp_l=[A,B]
    l.append(temp_l)
arr=np.array(l,dtype=np.int64)
# print(l)
# print(arr)

need=M
ans=0


col_num=0
# route=np.sort(arr,axis=0)  #numpyソートの仕方がおかしい
route=arr[np.argsort(arr[:,col_num])]
# print(route)
for i in range(N):
    if need >= route[i,1]:
        ans+=route[i,0]*route[i,1]
        need-=route[i,1]
        if need==0:
            break
        else:
            continue
    else:
        ans+=route[i,0]*need
        need=0
print(ans)