n,m = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(n)]

ab = sorted(ab)

money = 0
for i in ab:
    money += i[0]*min(m,i[1])
    m -= min(m,i[1])
    
    if m<=0:
        break

print(money) n,m = map(int,input().split()) n 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(map(int,input().split())) for _ in range(n)] ab [list(map(int,input().split())) for _ in range(n)] ab = sorted(ab) ab sorted(ab) sorted ab money = 0 money 0 for i in ab:
    money += i[0]*min(m,i[1])
    m -= min(m,i[1])
    
    if m<=0:
        break i ab money += i[0]*min(m,i[1]) money i[0]*min(m,i[1]) i[0] i 0 min(m,i[1]) min m i[1] i 1 m -= min(m,i[1]) m min(m,i[1]) min m i[1] i 1 if m<=0:
        break m<=0 m 0 break print(money) print money m = map(int,input().split()) map(int,input().split()) m ab = [list(map(int,input().split())) for _ in range(n)] [list(map(int,input().split())) for _ in range(n)] ab ab = sorted(ab) sorted(ab) ab n,m = map(int,input().split()) map(int,input().split()) n money = 0 0 money m -= min(m,i[1]) min(m,i[1]) m money += i[0]*min(m,i[1]) i[0]*min(m,i[1]) money
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(n)]

ab = sorted(ab)

money = 0
for i in ab:
    money += i[0]*min(m,i[1])
    m -= min(m,i[1])
    
    if m<=0:
        break

print(money)