#import sys

#import numpy as np

#import math

#import itertools

#from fractions import Fraction

#import itertools

from collections import deque

#import heapq

#from fractions  import gcd

#input=sys.stdin.readline

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

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

res=0

ans=0

b.sort(key=lambda x: x[0])

for i in range(n):

    if res+b[i][1]<=m:

        ans+=b[i][0]*b[i][1]

        res+=b[i][1]

    else:

        ans+=b[i][0]*(m-res)

        break

print(ans)
#python 2.7

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

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

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

res=ans=0

for i in range(n):

  if res+ab[i][1]>=m:

    ans+=(ab[i][0])*(m-res)

    break

  else:

    ans+=(ab[i][0])*ab[i][1]

    res+=ab[i][1]

print(ans)
# import sys
# import numpy as np
# import math
# import itertools
# from fractions import Fraction
# import itertools
from collections import deque

# import heapq
# from fractions  import gcd
# input=sys.stdin.readline
n, m = list(map(int, input().split()))
b = [list(map(int, input().split())) for _ in range(n)]
res = 0
ans = 0
b.sort(key=lambda x: x[0])
for i in range(n):
    if res + b[i][1] <= m:
        ans += b[i][0] * b[i][1]
        res += b[i][1]
    else:
        ans += b[i][0] * (m - res)
        break
print(ans)

# python 2.7
n, m = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(n)]
ab = sorted(ab, key=lambda x: x[0])
res = ans = 0
for i in range(n):
    if res + ab[i][1] >= m:
        ans += (ab[i][0]) * (m - res)
        break
    else:
        ans += (ab[i][0]) * ab[i][1]
        res += ab[i][1]
print(ans)

-# import sys -# import numpy as np -# import math -# import itertools -# from fractions import Fraction -# import itertools -from collections import deque - -# import heapq -# from fractions  import gcd -# input=sys.stdin.readline +# python 2.7 -b = [list(map(int, input().split())) for _ in range(n)] -res = 0 -ans = 0 -b.sort(key=lambda x: x[0]) +ab = [list(map(int, input().split())) for i in range(n)] +ab = sorted(ab, key=lambda x: x[0]) +res = ans = 0 -    if res + b[i][1] <= m: -        ans += b[i][0] * b[i][1] -        res += b[i][1] +    if res + ab[i][1] >= m: +        ans += (ab[i][0]) * (m - res) +        break -        ans += b[i][0] * (m - res) -        break +        ans += (ab[i][0]) * ab[i][1] +        res += ab[i][1]