import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, m = map(int, readline().split())
ab = [list(map(int, readline().split())) for _ in range(n)]

ab.sort()

cnt = 0
ans = 0
for a, b in ab:
    if cnt + b < m:
        cnt += b
        ans += b * a
    else:
        ans += (m - cnt) * a
        break
print(ans) import sys sys read = sys.stdin.buffer.read read sys.stdin.buffer.read sys.stdin.buffer sys.stdin sys stdin buffer read readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline readlines = sys.stdin.buffer.readlines readlines sys.stdin.buffer.readlines sys.stdin.buffer sys.stdin sys stdin buffer readlines n, m = map(int, readline().split()) n map(int, readline().split()) map int readline().split() ().split () readline split m list(map(int, readline().split())) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(map(int, readline().split())) list map(int, readline().split()) map int readline().split() ().split () readline split ab = [list(map(int, readline().split())) for _ in range(n)] ab [list(map(int, readline().split())) for _ in range(n)] ab.sort() ab.sort ab sort cnt = 0 cnt 0 ans = 0 ans 0 for a, b in ab:
    if cnt + b < m:
        cnt += b
        ans += b * a
    else:
        ans += (m - cnt) * a
        break a b ab if cnt + b < m:
        cnt += b
        ans += b * a
    else:
        ans += (m - cnt) * a
        break cnt + b < m cnt + b cnt b m cnt += b cnt b ans += b * a ans b * a b a ans += (m - cnt) * a ans (m - cnt) * a m - cnt m cnt a break print(ans) print ans n, m = map(int, readline().split()) map(int, readline().split()) n cnt += b b cnt cnt = 0 0 cnt readlines = sys.stdin.buffer.readlines sys.stdin.buffer.readlines readlines readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline ans += b * a b * a ans read = sys.stdin.buffer.read sys.stdin.buffer.read read ans += (m - cnt) * a (m - cnt) * a ans ab = [list(map(int, readline().split())) for _ in range(n)] [list(map(int, readline().split())) for _ in range(n)] ab ans = 0 0 ans m = map(int, readline().split()) map(int, readline().split()) m
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, m = map(int, readline().split())
ab = [list(map(int, readline().split())) for _ in range(n)]

ab.sort()

cnt = 0
ans = 0
for a, b in ab:
    if cnt + b < m:
        cnt += b
        ans += b * a
    else:
        ans += (m - cnt) * a
        break
print(ans)