from math import ceil
def solve():
    ans = 0
    N, M = map(int, input().split())
    A = [list(map(int, input().split())) for _ in range(N)]
    A.sort()
    for i in range(N):
        if M<=A[i][1]:
            ans += M*A[i][0]
            break
        else:
            ans += A[i][0]*A[i][1]
            M -= A[i][1]
    return ans
print(solve()) from math import ceil def solve():
    ans = 0
    N, M = map(int, input().split())
    A = [list(map(int, input().split())) for _ in range(N)]
    A.sort()
    for i in range(N):
        if M<=A[i][1]:
            ans += M*A[i][0]
            break
        else:
            ans += A[i][0]*A[i][1]
            M -= A[i][1]
    return ans solve ans = 0 ans 0 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 _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split A = [list(map(int, input().split())) for _ in range(N)] A [list(map(int, input().split())) for _ in range(N)] A.sort() A.sort A sort for i in range(N):
        if M<=A[i][1]:
            ans += M*A[i][0]
            break
        else:
            ans += A[i][0]*A[i][1]
            M -= A[i][1]
     i range(N) range N if M<=A[i][1]:
            ans += M*A[i][0]
            break
        else:
            ans += A[i][0]*A[i][1]
            M -= A[i][1]
     M<=A[i][1] M A[i][1] [i] A i 1 ans += M*A[i][0] ans M*A[i][0] M A[i][0] [i] A i 0 break ans += A[i][0]*A[i][1] ans A[i][0]*A[i][1] A[i][0] [i] A i 0 A[i][1] [i] A i 1 M -= A[i][1] M A[i][1] [i] A i 1 return ans ans print(solve()) print solve() solve def solve():
    ans = 0
    N, M = map(int, input().split())
    A = [list(map(int, input().split())) for _ in range(N)]
    A.sort()
    for i in range(N):
        if M<=A[i][1]:
            ans += M*A[i][0]
            break
        else:
            ans += A[i][0]*A[i][1]
            M -= A[i][1]
    return ans def solve():
    ans = 0
    N, M = map(int, input().split())
    A = [list(map(int, input().split())) for _ in range(N)]
    A.sort()
    for i in range(N):
        if M<=A[i][1]:
            ans += M*A[i][0]
            break
        else:
            ans += A[i][0]*A[i][1]
            M -= A[i][1]
    return ans solve
from math import ceil
def solve():
    ans = 0
    N, M = map(int, input().split())
    A = [list(map(int, input().split())) for _ in range(N)]
    A.sort()
    for i in range(N):
        if M<=A[i][1]:
            ans += M*A[i][0]
            break
        else:
            ans += A[i][0]*A[i][1]
            M -= A[i][1]
    return ans
print(solve())