li=[]
N,M=map(int,input().split())

for i in range(N):
    a,b=map(int,input().split())
    li.append([a,b])

li.sort()

g=0
s=0

for i in range(N):
    if li[i][1]+s<M:
        s+=li[i][1]
        g+=li[i][1]*li[i][0]
    else:
        g+=(M-s)*li[i][0]
        print(g)
        exit() li=[] li [] N,M=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split M for i in range(N):
    a,b=map(int,input().split())
    li.append([a,b]) i range(N) range N a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b li.append([a,b]) li.append li append [a,b] a b li.sort() li.sort li sort g=0 g 0 s=0 s 0 for i in range(N):
    if li[i][1]+s<M:
        s+=li[i][1]
        g+=li[i][1]*li[i][0]
    else:
        g+=(M-s)*li[i][0]
        print(g)
        exit() i range(N) range N if li[i][1]+s<M:
        s+=li[i][1]
        g+=li[i][1]*li[i][0]
    else:
        g+=(M-s)*li[i][0]
        print(g)
        exit() li[i][1]+s<M li[i][1]+s li[i][1] [i] li i 1 s M s+=li[i][1] s li[i][1] [i] li i 1 g+=li[i][1]*li[i][0] g li[i][1]*li[i][0] li[i][1] [i] li i 1 li[i][0] [i] li i 0 g+=(M-s)*li[i][0] g (M-s)*li[i][0] M-s M s li[i][0] [i] li i 0 print(g) print g exit() exit a,b=map(int,input().split()) map(int,input().split()) a b=map(int,input().split()) map(int,input().split()) b s=0 0 s N,M=map(int,input().split()) map(int,input().split()) N g+=li[i][1]*li[i][0] li[i][1]*li[i][0] g g=0 0 g g+=(M-s)*li[i][0] (M-s)*li[i][0] g li=[] [] li s+=li[i][1] li[i][1] s M=map(int,input().split()) map(int,input().split()) M
li=[]
N,M=map(int,input().split())

for i in range(N):
    a,b=map(int,input().split())
    li.append([a,b])

li.sort()

g=0
s=0

for i in range(N):
    if li[i][1]+s<M:
        s+=li[i][1]
        g+=li[i][1]*li[i][0]
    else:
        g+=(M-s)*li[i][0]
        print(g)
        exit()
