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