#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n,m = readInts()
AB = []
for i in range(n):
    a,b = readInts()
    AB.append((a,b))
AB = sorted(AB, key = lambda x:x[0])
#print(AB)
num = 0
cost = 0
for a,b in AB:
    if m >= num + b:
        num += b
        cost += a*b
    else:
        cost += a*(m - num)
        num = m
print(cost) from fractions import gcd from itertools import combinations,permutations,accumulate from collections import deque,defaultdict,Counter import decimal decimal import re re import sys sys sys.setrecursionlimit(10000000) sys.setrecursionlimit sys setrecursionlimit 10000000 mod = 10**9 + 7 mod 10**9 + 7 10**9 10 9 7 def readInts():
  return list(map(int,input().split())) readInts return list(map(int,input().split())) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split def I():
  return int(input()) I return int(input()) int(input()) int input() input n,m = readInts() n readInts() readInts m AB = [] AB [] for i in range(n):
    a,b = readInts()
    AB.append((a,b)) i range(n) range n a,b = readInts() a readInts() readInts b AB.append((a,b)) AB.append AB append (a,b) a b AB = sorted(AB, key = lambda x:x[0]) AB sorted(AB, key = lambda x:x[0]) sorted AB key = lambda x:x[0] key lambda x:x[0] x[0] x 0 x num = 0 num 0 cost = 0 cost 0 for a,b in AB:
    if m >= num + b:
        num += b
        cost += a*b
    else:
        cost += a*(m - num)
        num = m a b AB if m >= num + b:
        num += b
        cost += a*b
    else:
        cost += a*(m - num)
        num = m m >= num + b m num + b num b num += b num b cost += a*b cost a*b a b cost += a*(m - num) cost a*(m - num) a m - num m num num = m num m print(cost) print cost AB = [] [] AB a,b = readInts() readInts() a b = readInts() readInts() b num += b b num cost = 0 0 cost mod = 10**9 + 7 10**9 + 7 mod m = readInts() readInts() m def I():
  return int(input()) def I():
  return int(input()) I num = m m num n,m = readInts() readInts() n cost += a*(m - num) a*(m - num) cost AB = sorted(AB, key = lambda x:x[0]) sorted(AB, key = lambda x:x[0]) AB cost += a*b a*b cost num = 0 0 num def readInts():
  return list(map(int,input().split())) def readInts():
  return list(map(int,input().split())) readInts
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n,m = readInts()
AB = []
for i in range(n):
    a,b = readInts()
    AB.append((a,b))
AB = sorted(AB, key = lambda x:x[0])
#print(AB)
num = 0
cost = 0
for a,b in AB:
    if m >= num + b:
        num += b
        cost += a*b
    else:
        cost += a*(m - num)
        num = m
print(cost)
