N,M=map(int,input().split())
ab=[list(map(int,input().split())) for i in range(N)]
ab = sorted(ab)

SUM=0
for i in range(N):
  a,b=ab[i]
  x = min(M,b)
  SUM += a*x
  M -= x
  if M==0:break
    
print(SUM) 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(ab) ab sorted(ab) sorted ab SUM=0 SUM 0 for i in range(N):
  a,b=ab[i]
  x = min(M,b)
  SUM += a*x
  M -= x
  if M==0:break
     i range(N) range N a,b=ab[i] a ab[i] ab i b x = min(M,b) x min(M,b) min M b SUM += a*x SUM a*x a x M -= x M x if M==0:break
     M==0 M 0 print(SUM) print SUM M -= x x M N,M=map(int,input().split()) map(int,input().split()) N ab = sorted(ab) sorted(ab) ab SUM=0 0 SUM b=ab[i] ab[i] b SUM += a*x a*x SUM ab=[list(map(int,input().split())) for i in range(N)] [list(map(int,input().split())) for i in range(N)] ab x = min(M,b) min(M,b) x a,b=ab[i] ab[i] a M=map(int,input().split()) map(int,input().split()) M
N,M=map(int,input().split())
ab=[list(map(int,input().split())) for i in range(N)]
ab = sorted(ab)

SUM=0
for i in range(N):
  a,b=ab[i]
  x = min(M,b)
  SUM += a*x
  M -= x
  if M==0:break
    
print(SUM)