n,m = map(int,input().split())

array = []
[array.append(list(map(int,input().split()))) for x in range(n)]

total = 0

array.sort()

for yen,num in array:
    if num < m:
        total += yen*num
        m -= num
    else:
        total += yen*m
        break
print(total) n,m = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m array = [] array [] array.append(list(map(int,input().split()))) for x in range(n) for x in range(n) x range(n) range n for x in range(n) array.append(list(map(int,input().split()))) array.append array append list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split [array.append(list(map(int,input().split()))) for x in range(n)] total = 0 total 0 array.sort() array.sort array sort for yen,num in array:
    if num < m:
        total += yen*num
        m -= num
    else:
        total += yen*m
        break yen num array if num < m:
        total += yen*num
        m -= num
    else:
        total += yen*m
        break num < m num m total += yen*num total yen*num yen num m -= num m num total += yen*m total yen*m yen m break print(total) print total array = [] [] array m = map(int,input().split()) map(int,input().split()) m m -= num num m total = 0 0 total total += yen*num yen*num total n,m = map(int,input().split()) map(int,input().split()) n total += yen*m yen*m total
n,m = map(int,input().split())

array = []
[array.append(list(map(int,input().split()))) for x in range(n)]

total = 0

array.sort()

for yen,num in array:
    if num < m:
        total += yen*num
        m -= num
    else:
        total += yen*m
        break
print(total)
