import sys
input = sys.stdin.readline
from collections import *

N, M = map(int, input().split())
AB = [tuple(map(int, input().split())) for _ in range(N)]
AB.sort(key=lambda t: t[0])
ans = 0

for A, B in AB:
    if M-B>=0:
        ans += A*B
        M -= B
    else:
        ans += A*M
        break

print(ans) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline from collections import * N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M tuple(map(int, input().split())) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) tuple(map(int, input().split())) tuple map(int, input().split()) map int input().split() ().split () input split AB = [tuple(map(int, input().split())) for _ in range(N)] AB [tuple(map(int, input().split())) for _ in range(N)] AB.sort(key=lambda t: t[0]) AB.sort AB sort key=lambda t: t[0] key lambda t: t[0] t[0] t 0 t ans = 0 ans 0 for A, B in AB:
    if M-B>=0:
        ans += A*B
        M -= B
    else:
        ans += A*M
        break A B AB if M-B>=0:
        ans += A*B
        M -= B
    else:
        ans += A*M
        break M-B>=0 M-B M B 0 ans += A*B ans A*B A B M -= B M B ans += A*M ans A*M A M break print(ans) print ans M = map(int, input().split()) map(int, input().split()) M AB = [tuple(map(int, input().split())) for _ in range(N)] [tuple(map(int, input().split())) for _ in range(N)] AB M -= B B M ans = 0 0 ans ans += A*M A*M ans input = sys.stdin.readline sys.stdin.readline input N, M = map(int, input().split()) map(int, input().split()) N ans += A*B A*B ans
import sys
input = sys.stdin.readline
from collections import *

N, M = map(int, input().split())
AB = [tuple(map(int, input().split())) for _ in range(N)]
AB.sort(key=lambda t: t[0])
ans = 0

for A, B in AB:
    if M-B>=0:
        ans += A*B
        M -= B
    else:
        ans += A*M
        break

print(ans)