n,m=map(int,input().split())
ab=[list(map(int,input().split())) for i in range(n)]
ab.sort()
ans=0
for i in range(n):
    if m>ab[i][1]:
        ans+=ab[i][0]*ab[i][1]
        m-=ab[i][1]
    else:
        ans+=ab[i][0]*m
        print(ans)
        break 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 ab=[list(map(int,input().split())) for i in range(n)] ab [list(map(int,input().split())) for i in range(n)] ab.sort() ab.sort ab sort ans=0 ans 0 for i in range(n):
    if m>ab[i][1]:
        ans+=ab[i][0]*ab[i][1]
        m-=ab[i][1]
    else:
        ans+=ab[i][0]*m
        print(ans)
        break i range(n) range n if m>ab[i][1]:
        ans+=ab[i][0]*ab[i][1]
        m-=ab[i][1]
    else:
        ans+=ab[i][0]*m
        print(ans)
        break m>ab[i][1] m ab[i][1] [i] ab i 1 ans+=ab[i][0]*ab[i][1] ans ab[i][0]*ab[i][1] ab[i][0] [i] ab i 0 ab[i][1] [i] ab i 1 m-=ab[i][1] m ab[i][1] [i] ab i 1 ans+=ab[i][0]*m ans ab[i][0]*m ab[i][0] [i] ab i 0 m print(ans) print ans break n,m=map(int,input().split()) map(int,input().split()) n ab=[list(map(int,input().split())) for i in range(n)] [list(map(int,input().split())) for i in range(n)] ab ans+=ab[i][0]*ab[i][1] ab[i][0]*ab[i][1] ans m=map(int,input().split()) map(int,input().split()) m ans=0 0 ans ans+=ab[i][0]*m ab[i][0]*m ans m-=ab[i][1] ab[i][1] m
n,m=map(int,input().split())
ab=[list(map(int,input().split())) for i in range(n)]
ab.sort()
ans=0
for i in range(n):
    if m>ab[i][1]:
        ans+=ab[i][0]*ab[i][1]
        m-=ab[i][1]
    else:
        ans+=ab[i][0]*m
        print(ans)
        break