n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
ab.sort(key = lambda x:x[0])
ans = 0
for a, b in ab:
    ans += a * min(b, m)
    m -= b
    if m <= 0:
        break
print(ans) 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 ab = [list(map(int, input().split())) for _ in range(n)] ab [list(map(int, input().split())) for _ in range(n)] ab.sort(key = lambda x:x[0]) ab.sort ab sort key = lambda x:x[0] key lambda x:x[0] x[0] x 0 x ans = 0 ans 0 for a, b in ab:
    ans += a * min(b, m)
    m -= b
    if m <= 0:
        break a b ab ans += a * min(b, m) ans a * min(b, m) a min(b, m) min b m m -= b m b if m <= 0:
        break m <= 0 m 0 break print(ans) print ans ans += a * min(b, m) a * min(b, m) ans m = map(int, input().split()) map(int, input().split()) m ab = [list(map(int, input().split())) for _ in range(n)] [list(map(int, input().split())) for _ in range(n)] ab ans = 0 0 ans m -= b b m n, m = map(int, input().split()) map(int, input().split()) n
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
ab.sort(key = lambda x:x[0])
ans = 0
for a, b in ab:
    ans += a * min(b, m)
    m -= b
    if m <= 0:
        break
print(ans)