#a値段,b本数
#n軒,m本
n,m = list(map(int, input().split()))

ab_list = [list(map(int, input().split())) for _ in range(n)]
#print(ab_list)
ab_list.sort()
ans = 0
num = 0
for ab in ab_list:
    ans += ab[0]*ab[1]
    num += ab[1]
    if num >= m:
        i_stop=ab_list.index(ab)
        break
diff_num = num - m
ans -= diff_num * ab_list[i_stop][0]
print(ans) n,m = list(map(int, input().split())) n list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split m list(map(int, input().split())) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ab_list = [list(map(int, input().split())) for _ in range(n)] ab_list [list(map(int, input().split())) for _ in range(n)] ab_list.sort() ab_list.sort ab_list sort ans = 0 ans 0 num = 0 num 0 for ab in ab_list:
    ans += ab[0]*ab[1]
    num += ab[1]
    if num >= m:
        i_stop=ab_list.index(ab)
        break ab ab_list ans += ab[0]*ab[1] ans ab[0]*ab[1] ab[0] ab 0 ab[1] ab 1 num += ab[1] num ab[1] ab 1 if num >= m:
        i_stop=ab_list.index(ab)
        break num >= m num m i_stop=ab_list.index(ab) i_stop ab_list.index(ab) ab_list.index ab_list index ab break diff_num = num - m diff_num num - m num m ans -= diff_num * ab_list[i_stop][0] ans diff_num * ab_list[i_stop][0] diff_num ab_list[i_stop][0] [i_stop] ab_list i_stop 0 print(ans) print ans n,m = list(map(int, input().split())) list(map(int, input().split())) n ab_list = [list(map(int, input().split())) for _ in range(n)] [list(map(int, input().split())) for _ in range(n)] ab_list ans = 0 0 ans num = 0 0 num num += ab[1] ab[1] num m = list(map(int, input().split())) list(map(int, input().split())) m ans += ab[0]*ab[1] ab[0]*ab[1] ans ans -= diff_num * ab_list[i_stop][0] diff_num * ab_list[i_stop][0] ans i_stop=ab_list.index(ab) ab_list.index(ab) i_stop diff_num = num - m num - m diff_num
#a値段,b本数
#n軒,m本
n,m = list(map(int, input().split()))

ab_list = [list(map(int, input().split())) for _ in range(n)]
#print(ab_list)
ab_list.sort()
ans = 0
num = 0
for ab in ab_list:
    ans += ab[0]*ab[1]
    num += ab[1]
    if num >= m:
        i_stop=ab_list.index(ab)
        break
diff_num = num - m
ans -= diff_num * ab_list[i_stop][0]
print(ans)