n,m = map(int,input().split())
drink = []
for i in range(n):
    a,b = map(int,input().split())
    drink.append((a,b))
drink.sort()
ans = 0
for i in range(n):
    if m == 0:
        break
    if m >= drink[i][1]:
        ans += drink[i][0] * drink[i][1]
        m -= drink[i][1]
    else:
        ans += m*drink[i][0]
        m = 0
print(ans) n,m = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m drink = [] drink [] for i in range(n):
    a,b = map(int,input().split())
    drink.append((a,b)) i range(n) range n a,b = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b drink.append((a,b)) drink.append drink append (a,b) a b drink.sort() drink.sort drink sort ans = 0 ans 0 for i in range(n):
    if m == 0:
        break
    if m >= drink[i][1]:
        ans += drink[i][0] * drink[i][1]
        m -= drink[i][1]
    else:
        ans += m*drink[i][0]
        m = 0 i range(n) range n if m == 0:
        break
     m == 0 m 0 break if m >= drink[i][1]:
        ans += drink[i][0] * drink[i][1]
        m -= drink[i][1]
    else:
        ans += m*drink[i][0]
        m = 0 m >= drink[i][1] m drink[i][1] [i] drink i 1 ans += drink[i][0] * drink[i][1] ans drink[i][0] * drink[i][1] drink[i][0] [i] drink i 0 drink[i][1] [i] drink i 1 m -= drink[i][1] m drink[i][1] [i] drink i 1 ans += m*drink[i][0] ans m*drink[i][0] m drink[i][0] [i] drink i 0 m = 0 m 0 print(ans) print ans b = map(int,input().split()) map(int,input().split()) b ans += m*drink[i][0] m*drink[i][0] ans a,b = map(int,input().split()) map(int,input().split()) a m = map(int,input().split()) map(int,input().split()) m drink = [] [] drink m -= drink[i][1] drink[i][1] m n,m = map(int,input().split()) map(int,input().split()) n m = 0 0 m ans = 0 0 ans ans += drink[i][0] * drink[i][1] drink[i][0] * drink[i][1] ans
n,m = map(int,input().split())
drink = []
for i in range(n):
    a,b = map(int,input().split())
    drink.append((a,b))
drink.sort()
ans = 0
for i in range(n):
    if m == 0:
        break
    if m >= drink[i][1]:
        ans += drink[i][0] * drink[i][1]
        m -= drink[i][1]
    else:
        ans += m*drink[i][0]
        m = 0
print(ans)
