n,m=map(int,input().split())
ab=[list(map(int,input().split())) for i in range(n)]

ab_sorted = sorted(ab, key=lambda x:(x[0], -x[1]))

num = 0
amount_of_money = 0
for i in range(n):
  buy = min(ab_sorted[i][1], m-num)
  num += buy
  amount_of_money += ab_sorted[i][0] * buy
    
  if num >= m:
    print(amount_of_money)
    exit(0) 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 i in range(n) for i in range(n) i range(n) range n for i 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 i in range(n)] ab [list(map(int,input().split())) for i in range(n)] ab_sorted = sorted(ab, key=lambda x:(x[0], -x[1])) ab_sorted sorted(ab, key=lambda x:(x[0], -x[1])) sorted ab key=lambda x:(x[0], -x[1]) key lambda x:(x[0], -x[1]) (x[0], -x[1]) x[0] x 0 -x[1] x[1] x 1 x num = 0 num 0 amount_of_money = 0 amount_of_money 0 for i in range(n):
  buy = min(ab_sorted[i][1], m-num)
  num += buy
  amount_of_money += ab_sorted[i][0] * buy
    
  if num >= m:
    print(amount_of_money)
    exit(0) i range(n) range n buy = min(ab_sorted[i][1], m-num) buy min(ab_sorted[i][1], m-num) min ab_sorted[i][1] [i] ab_sorted i 1 m-num m num num += buy num buy amount_of_money += ab_sorted[i][0] * buy amount_of_money ab_sorted[i][0] * buy ab_sorted[i][0] [i] ab_sorted i 0 buy if num >= m:
    print(amount_of_money)
    exit(0) num >= m num m print(amount_of_money) print amount_of_money exit(0) exit 0 n,m=map(int,input().split()) map(int,input().split()) n amount_of_money += ab_sorted[i][0] * buy ab_sorted[i][0] * buy amount_of_money ab_sorted = sorted(ab, key=lambda x:(x[0], -x[1])) sorted(ab, key=lambda x:(x[0], -x[1])) ab_sorted m=map(int,input().split()) map(int,input().split()) m num += buy buy num num = 0 0 num amount_of_money = 0 0 amount_of_money buy = min(ab_sorted[i][1], m-num) min(ab_sorted[i][1], m-num) buy ab=[list(map(int,input().split())) for i in range(n)] [list(map(int,input().split())) for i in range(n)] ab
n,m=map(int,input().split())
ab=[list(map(int,input().split())) for i in range(n)]

ab_sorted = sorted(ab, key=lambda x:(x[0], -x[1]))

num = 0
amount_of_money = 0
for i in range(n):
  buy = min(ab_sorted[i][1], m-num)
  num += buy
  amount_of_money += ab_sorted[i][0] * buy
    
  if num >= m:
    print(amount_of_money)
    exit(0)
