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