#!/usr/bin/env python3
n, m = map(int, input().split())
v = []
ans = 0
for _ in range(n):
    a, b = map(int, input().split())
    v += [(a, b)]
v.sort(key=lambda x: x[0])
for i in v:
    m -= i[1]
    if m >= 0:
        ans += i[0]*i[1]
    else:
        m += i[1]
        ans += m*i[0]
        break
print(ans) n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m v = [] v [] ans = 0 ans 0 for _ in range(n):
    a, b = map(int, input().split())
    v += [(a, b)] _ range(n) range n a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b v += [(a, b)] v [(a, b)] (a, b) a b v.sort(key=lambda x: x[0]) v.sort v sort key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x for i in v:
    m -= i[1]
    if m >= 0:
        ans += i[0]*i[1]
    else:
        m += i[1]
        ans += m*i[0]
        break i v m -= i[1] m i[1] i 1 if m >= 0:
        ans += i[0]*i[1]
    else:
        m += i[1]
        ans += m*i[0]
        break m >= 0 m 0 ans += i[0]*i[1] ans i[0]*i[1] i[0] i 0 i[1] i 1 m += i[1] m i[1] i 1 ans += m*i[0] ans m*i[0] m i[0] i 0 break print(ans) print ans n, m = map(int, input().split()) map(int, input().split()) n m = map(int, input().split()) map(int, input().split()) m m += i[1] i[1] m v += [(a, b)] [(a, b)] v ans += m*i[0] m*i[0] ans ans += i[0]*i[1] i[0]*i[1] ans v = [] [] v a, b = map(int, input().split()) map(int, input().split()) a b = map(int, input().split()) map(int, input().split()) b ans = 0 0 ans m -= i[1] i[1] m
#!/usr/bin/env python3
n, m = map(int, input().split())
v = []
ans = 0
for _ in range(n):
    a, b = map(int, input().split())
    v += [(a, b)]
v.sort(key=lambda x: x[0])
for i in v:
    m -= i[1]
    if m >= 0:
        ans += i[0]*i[1]
    else:
        m += i[1]
        ans += m*i[0]
        break
print(ans)
