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