N,M = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(N)]

AB.sort()

money = 0
for a, b in AB:
  if M > b:
    money += a * b
    M -= b
  else:
    money += a * M
    break
    
print(money) 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 _ in range(N) for _ in range(N) _ range(N) range N for _ 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 _ in range(N)] AB [list(map(int,input().split())) for _ in range(N)] AB.sort() AB.sort AB sort money = 0 money 0 for a, b in AB:
  if M > b:
    money += a * b
    M -= b
  else:
    money += a * M
    break
     a b AB if M > b:
    money += a * b
    M -= b
  else:
    money += a * M
    break
     M > b M b money += a * b money a * b a b M -= b M b money += a * M money a * M a M break print(money) print money money += a * b a * b money AB = [list(map(int,input().split())) for _ in range(N)] [list(map(int,input().split())) for _ in range(N)] AB M = map(int,input().split()) map(int,input().split()) M money = 0 0 money M -= b b M money += a * M a * M money N,M = map(int,input().split()) map(int,input().split()) N
N,M = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(N)]

AB.sort()

money = 0
for a, b in AB:
  if M > b:
    money += a * b
    M -= b
  else:
    money += a * M
    break
    
print(money)