from operator import itemgetter
n,m=map(int,input().split())
li=[list(map(int, input().split())) for i in range(n)]
li.sort(key=itemgetter(0))
ans=0
i=0
for i in li:
    a,b=i[0],i[1]
    if m>=b:
        ans+=a*b
        m-=b
    else:
        ans+=a*m
        break
print(ans)
 from operator import itemgetter n,m=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m list(map(int, input().split())) for i in range(n) for i in range(n) i range(n) range n for i in range(n) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split li=[list(map(int, input().split())) for i in range(n)] li [list(map(int, input().split())) for i in range(n)] li.sort(key=itemgetter(0)) li.sort li sort key=itemgetter(0) key itemgetter(0) itemgetter 0 ans=0 ans 0 i=0 i 0 for i in li:
    a,b=i[0],i[1]
    if m>=b:
        ans+=a*b
        m-=b
    else:
        ans+=a*m
        break i li a,b=i[0],i[1] a i[0] i 0 b i[1] i 1 if m>=b:
        ans+=a*b
        m-=b
    else:
        ans+=a*m
        break m>=b m b ans+=a*b ans a*b a b m-=b m b ans+=a*m ans a*m a m break print(ans) print ans ans=0 0 ans m-=b b m i=0 0 i b=i[0],i[1] i[1] b m=map(int,input().split()) map(int,input().split()) m a,b=i[0],i[1] i[0] a ans+=a*m a*m ans li=[list(map(int, input().split())) for i in range(n)] [list(map(int, input().split())) for i in range(n)] li ans+=a*b a*b ans n,m=map(int,input().split()) map(int,input().split()) n
from operator import itemgetter
n,m=map(int,input().split())
li=[list(map(int, input().split())) for i in range(n)]
li.sort(key=itemgetter(0))
ans=0
i=0
for i in li:
    a,b=i[0],i[1]
    if m>=b:
        ans+=a*b
        m-=b
    else:
        ans+=a*m
        break
print(ans)

