class struct:

  def __init__(self,a,b):

    self.a=a

    self.b=b

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

l=[]

for i in range(n):

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

  l.append(struct(a,b))

l=sorted(l,key=lambda x:x.a)

su=0

for x in l:

  if x.b<m:

    m-=x.b

    su+=(x.a)*(x.b)

  else:

    su+=(x.a)*m

    break

print(su)
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time



sys.setrecursionlimit(10**7)

inf=10**20

mod=10**9+7



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

def I(): return int(eval(input()))

def LS(): return input().split()

def S(): return eval(input())



def main():

  n,m=LI()



  l=[]

  for _ in range(n):

    a,b=LI()

    l.append([a,b])



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



  sm=0

  for x in l:

    if m>x[1]:

      m-=x[1]

      sm+=x[0]*x[1]

    else:

      sm+=x[0]*m

      return sm



print((main()))

class struct:
    def __init__(self, a, b):
        self.a = a
        self.b = b


n, m = list(map(int, input().split()))
l = []
for i in range(n):
    a, b = list(map(int, input().split()))
    l.append(struct(a, b))
l = sorted(l, key=lambda x: x.a)
su = 0
for x in l:
    if x.b < m:
        m -= x.b
        su += (x.a) * (x.b)
    else:
        su += (x.a) * m
        break
print(su)

import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7


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


def I():
    return int(eval(input()))


def LS():
    return input().split()


def S():
    return eval(input())


def main():
    n, m = LI()
    l = []
    for _ in range(n):
        a, b = LI()
        l.append([a, b])
    l = sorted(l, key=lambda x: x[0])
    sm = 0
    for x in l:
        if m > x[1]:
            m -= x[1]
            sm += x[0] * x[1]
        else:
            sm += x[0] * m
            return sm


print((main()))

-class struct: -    def __init__(self, a, b): -        self.a = a -        self.b = b +import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time + +sys.setrecursionlimit(10**7) +inf = 10**20 +mod = 10**9 + 7 -n, m = list(map(int, input().split())) -l = [] -for i in range(n): -    a, b = list(map(int, input().split())) -    l.append(struct(a, b)) -l = sorted(l, key=lambda x: x.a) -su = 0 -for x in l: -    if x.b < m: -        m -= x.b -        su += (x.a) * (x.b) -    else: -        su += (x.a) * m -        break -print(su) +def LI(): +    return list(map(int, input().split())) + + +def I(): +    return int(eval(input())) + + +def LS(): +    return input().split() + + +def S(): +    return eval(input()) + + +def main(): +    n, m = LI() +    l = [] +    for _ in range(n): +        a, b = LI() +        l.append([a, b]) +    l = sorted(l, key=lambda x: x[0]) +    sm = 0 +    for x in l: +        if m > x[1]: +            m -= x[1] +            sm += x[0] * x[1] +        else: +            sm += x[0] * m +            return sm + + +print((main()))