# n, m, l = map(int, input().split())

# list_n = list(map(int, input().split()))

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]

import sys
input = sys.stdin.readline

N, M = map(int, input().split())
L = []
for i in range(N):
    a, b = map(int, input().split())
    L.append((a, b))
L = sorted(L, key=lambda x: x[0])

n = 0
ans = 0
for i in range(N):
    if n + L[i][1] <= M:
        ans += L[i][1] * L[i][0]
        n += L[i][1]
    else:
        ans += (M-n) * L[i][0]
        n = M
        break
print(ans) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M L = [] L [] for i in range(N):
    a, b = map(int, input().split())
    L.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 L.append((a, b)) L.append L append (a, b) a b L = sorted(L, key=lambda x: x[0]) L sorted(L, key=lambda x: x[0]) sorted L key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x n = 0 n 0 ans = 0 ans 0 for i in range(N):
    if n + L[i][1] <= M:
        ans += L[i][1] * L[i][0]
        n += L[i][1]
    else:
        ans += (M-n) * L[i][0]
        n = M
        break i range(N) range N if n + L[i][1] <= M:
        ans += L[i][1] * L[i][0]
        n += L[i][1]
    else:
        ans += (M-n) * L[i][0]
        n = M
        break n + L[i][1] <= M n + L[i][1] n L[i][1] [i] L i 1 M ans += L[i][1] * L[i][0] ans L[i][1] * L[i][0] L[i][1] [i] L i 1 L[i][0] [i] L i 0 n += L[i][1] n L[i][1] [i] L i 1 ans += (M-n) * L[i][0] ans (M-n) * L[i][0] M-n M n L[i][0] [i] L i 0 n = M n M break print(ans) print ans a, b = map(int, input().split()) map(int, input().split()) a L = sorted(L, key=lambda x: x[0]) sorted(L, key=lambda x: x[0]) L input = sys.stdin.readline sys.stdin.readline input N, M = map(int, input().split()) map(int, input().split()) N L = [] [] L ans += (M-n) * L[i][0] (M-n) * L[i][0] ans M = map(int, input().split()) map(int, input().split()) M ans += L[i][1] * L[i][0] L[i][1] * L[i][0] ans ans = 0 0 ans n += L[i][1] L[i][1] n b = map(int, input().split()) map(int, input().split()) b n = M M n n = 0 0 n
# n, m, l = map(int, input().split())

# list_n = list(map(int, input().split()))

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]

import sys
input = sys.stdin.readline

N, M = map(int, input().split())
L = []
for i in range(N):
    a, b = map(int, input().split())
    L.append((a, b))
L = sorted(L, key=lambda x: x[0])

n = 0
ans = 0
for i in range(N):
    if n + L[i][1] <= M:
        ans += L[i][1] * L[i][0]
        n += L[i][1]
    else:
        ans += (M-n) * L[i][0]
        n = M
        break
print(ans)
