n,m = map(int,input().split())
ab = [list(map(int,input().split())) for j in range(n)]
ab.sort(key=lambda x:x[0])
#print(ab)
ans,i = 0,0

while(m>0):
  num = min(ab[i][1],m)
  ans += ab[i][0]*num
  #print(ans,num)
  m -= num
 #print(m)
  i += 1
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 j in range(n) for j in range(n) j range(n) range n for j 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 j in range(n)] ab [list(map(int,input().split())) for j in range(n)] ab.sort(key=lambda x:x[0]) ab.sort ab sort key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x ans,i = 0,0 ans 0 i 0 while(m>0):
  num = min(ab[i][1],m)
  ans += ab[i][0]*num
  #print(ans,num)
  m -= num
 #print(m)
  i += 1 m>0 m 0 num = min(ab[i][1],m) num min(ab[i][1],m) min ab[i][1] [i] ab i 1 m ans += ab[i][0]*num ans ab[i][0]*num ab[i][0] [i] ab i 0 num m -= num m num i += 1 i 1 print(ans) print ans m -= num num m i = 0,0 0 i ans += ab[i][0]*num ab[i][0]*num ans m = map(int,input().split()) map(int,input().split()) m i += 1 1 i ab = [list(map(int,input().split())) for j in range(n)] [list(map(int,input().split())) for j in range(n)] ab n,m = map(int,input().split()) map(int,input().split()) n num = min(ab[i][1],m) min(ab[i][1],m) num ans,i = 0,0 0 ans
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for j in range(n)]
ab.sort(key=lambda x:x[0])
#print(ab)
ans,i = 0,0

while(m>0):
  num = min(ab[i][1],m)
  ans += ab[i][0]*num
  #print(ans,num)
  m -= num
 #print(m)
  i += 1
print(ans)