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