n,m=map(int,input().split())
dic={}
doll=0
AB=[list(map(int,input().split())) for _ in range(n)]
AB.sort()
for k,v in AB:
  if v<m:
    doll+=k*v
    m-=v
  else:
    doll+=k*m
    print(doll)
    exit() n,m=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m dic={} dic {} doll=0 doll 0 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 for k,v in AB:
  if v<m:
    doll+=k*v
    m-=v
  else:
    doll+=k*m
    print(doll)
    exit() k v AB if v<m:
    doll+=k*v
    m-=v
  else:
    doll+=k*m
    print(doll)
    exit() v<m v m doll+=k*v doll k*v k v m-=v m v doll+=k*m doll k*m k m print(doll) print doll exit() exit dic={} {} dic doll=0 0 doll m=map(int,input().split()) map(int,input().split()) m doll+=k*v k*v doll m-=v v m AB=[list(map(int,input().split())) for _ in range(n)] [list(map(int,input().split())) for _ in range(n)] AB n,m=map(int,input().split()) map(int,input().split()) n doll+=k*m k*m doll
n,m=map(int,input().split())
dic={}
doll=0
AB=[list(map(int,input().split())) for _ in range(n)]
AB.sort()
for k,v in AB:
  if v<m:
    doll+=k*v
    m-=v
  else:
    doll+=k*m
    print(doll)
    exit()