import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())

N,M = MI()
AB = [tuple(MI()) for _ in range(N)]
AB.sort()

ans = 0
i = 0
while M > 0:
    A,B = AB[i]
    if M >= B:
        ans += A*B
        M -= B
        i += 1
    else:
        ans += A*M
        break
print(ans) import sys sys def MI(): return map(int,sys.stdin.readline().rstrip().split()) MI N,M = MI() N MI() MI M tuple(MI()) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) tuple(MI()) tuple MI() MI AB = [tuple(MI()) for _ in range(N)] AB [tuple(MI()) for _ in range(N)] AB.sort() AB.sort AB sort ans = 0 ans 0 i = 0 i 0 while M > 0:
    A,B = AB[i]
    if M >= B:
        ans += A*B
        M -= B
        i += 1
    else:
        ans += A*M
        break M > 0 M 0 A,B = AB[i] A AB[i] AB i B if M >= B:
        ans += A*B
        M -= B
        i += 1
    else:
        ans += A*M
        break M >= B M B ans += A*B ans A*B A B M -= B M B i += 1 i 1 ans += A*M ans A*M A M break print(ans) print ans M = MI() MI() M A,B = AB[i] AB[i] A ans += A*M A*M ans i = 0 0 i B = AB[i] AB[i] B i += 1 1 i AB = [tuple(MI()) for _ in range(N)] [tuple(MI()) for _ in range(N)] AB M -= B B M N,M = MI() MI() N ans = 0 0 ans ans += A*B A*B ans def MI(): return map(int,sys.stdin.readline().rstrip().split()) def MI(): return map(int,sys.stdin.readline().rstrip().split()) MI
import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())

N,M = MI()
AB = [tuple(MI()) for _ in range(N)]
AB.sort()

ans = 0
i = 0
while M > 0:
    A,B = AB[i]
    if M >= B:
        ans += A*B
        M -= B
        i += 1
    else:
        ans += A*M
        break
print(ans)
