#from statistics import median

#import collections

#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]

#from itertools import combinations # (string,3) 3回

#from collections import deque

#import collections.defaultdict(list)

#import bisect

#

#

# pythonで無理なときは、pypyでやると正解するかも！！

#

#



mod = 10**9 + 7



def readInts():

  return list(map(int,input().split()))

def main():

    n,m = readInts()

    shop = []

    for i in range(n):

        mon,num = readInts()

        shop.append([mon,num])

    shop = sorted(shop,key = lambda x:x[0])# お金でソートする 昇順(小さい物順)

    now = 0

    cost = 0

    for i in range(n):

        mon,num = shop[i]

        # 展開

        if now < m: # 今何本あるか

            buy = min(num,m - now) # 何本か?

            cost += mon * buy

            now += buy

        if now == m:

            break

    print(cost)



if __name__ == '__main__':

  main()

# Aiでソートしてあげたほうがいいね？

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

drink = []

for i in range(n):

    a,b = list(map(int,input().split()))

    drink.append([a,b])

drink = sorted(drink,key = lambda x:x[0])

#print(drink)

total = 0

cnt = 0

for price,num in drink:

    if cnt == m:

        break

    if cnt + num <= m:

        cnt += num

        total += num * price

    else:

        nya = max(abs(m - (cnt)),0)

        #print(nya)

        #print("?",abs(m - (num+cnt)),num,cnt)

        cnt += nya

        total += nya * price

print(total)

# from statistics import median
# import collections
# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
# from itertools import combinations # (string,3) 3回
# from collections import deque
# import collections.defaultdict(list)
# import bisect
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
mod = 10**9 + 7


def readInts():
    return list(map(int, input().split()))


def main():
    n, m = readInts()
    shop = []
    for i in range(n):
        mon, num = readInts()
        shop.append([mon, num])
    shop = sorted(shop, key=lambda x: x[0])  # お金でソートする 昇順(小さい物順)
    now = 0
    cost = 0
    for i in range(n):
        mon, num = shop[i]
        # 展開
        if now < m:  # 今何本あるか
            buy = min(num, m - now)  # 何本か?
            cost += mon * buy
            now += buy
        if now == m:
            break
    print(cost)


if __name__ == "__main__":
    main()

# Aiでソートしてあげたほうがいいね？
n, m = list(map(int, input().split()))
drink = []
for i in range(n):
    a, b = list(map(int, input().split()))
    drink.append([a, b])
drink = sorted(drink, key=lambda x: x[0])
# print(drink)
total = 0
cnt = 0
for price, num in drink:
    if cnt == m:
        break
    if cnt + num <= m:
        cnt += num
        total += num * price
    else:
        nya = max(abs(m - (cnt)), 0)
        # print(nya)
        # print("?",abs(m - (num+cnt)),num,cnt)
        cnt += nya
        total += nya * price
print(total)

-# from statistics import median -# import collections -# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0] -# from itertools import combinations # (string,3) 3回 -# from collections import deque -# import collections.defaultdict(list) -# import bisect -# -# -# pythonで無理なときは、pypyでやると正解するかも！！ -# -# -mod = 10**9 + 7 - - -def readInts(): -    return list(map(int, input().split())) - - -def main(): -    n, m = readInts() -    shop = [] -    for i in range(n): -        mon, num = readInts() -        shop.append([mon, num]) -    shop = sorted(shop, key=lambda x: x[0])  # お金でソートする 昇順(小さい物順) -    now = 0 -    cost = 0 -    for i in range(n): -        mon, num = shop[i] -        # 展開 -        if now < m:  # 今何本あるか -            buy = min(num, m - now)  # 何本か? -            cost += mon * buy -            now += buy -        if now == m: -            break -    print(cost) - - -if __name__ == "__main__": -    main() +# Aiでソートしてあげたほうがいいね？ +n, m = list(map(int, input().split())) +drink = [] +for i in range(n): +    a, b = list(map(int, input().split())) +    drink.append([a, b]) +drink = sorted(drink, key=lambda x: x[0]) +# print(drink) +total = 0 +cnt = 0 +for price, num in drink: +    if cnt == m: +        break +    if cnt + num <= m: +        cnt += num +        total += num * price +    else: +        nya = max(abs(m - (cnt)), 0) +        # print(nya) +        # print("?",abs(m - (num+cnt)),num,cnt) +        cnt += nya +        total += nya * price +print(total)