n,m=map(int,input().split())
d={};price=0
for _ in range(n):
  a,b=map(int,input().split())
  if a not in d:
    d[a] = b
  else:
    d[a] += b
d=sorted(d.items(),key=lambda x:x[0])
for i in d:
  for _ in range(i[1]):
    if m == 0:
      print(price)
      exit()
    m-=1
    price+=i[0]
else:
  print(price) n,m=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m d={} d {} price=0 price 0 for _ in range(n):
  a,b=map(int,input().split())
  if a not in d:
    d[a] = b
  else:
    d[a] += b _ range(n) range n a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b if a not in d:
    d[a] = b
  else:
    d[a] += b a not in d a d d[a] = b d[a] d a b d[a] += b d[a] d a b d=sorted(d.items(),key=lambda x:x[0]) d sorted(d.items(),key=lambda x:x[0]) sorted d.items() d.items d items key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x for i in d:
  for _ in range(i[1]):
    if m == 0:
      print(price)
      exit()
    m-=1
    price+=i[0]
else:
  print(price) i d for _ in range(i[1]):
    if m == 0:
      print(price)
      exit()
    m-=1
    price+=i[0] _ range(i[1]) range i[1] i 1 if m == 0:
      print(price)
      exit()
     m == 0 m 0 print(price) print price exit() exit m-=1 m 1 price+=i[0] price i[0] i 0 print(price) print price m=map(int,input().split()) map(int,input().split()) m n,m=map(int,input().split()) map(int,input().split()) n d={} {} d price+=i[0] i[0] price a,b=map(int,input().split()) map(int,input().split()) a b=map(int,input().split()) map(int,input().split()) b price=0 0 price m-=1 1 m d=sorted(d.items(),key=lambda x:x[0]) sorted(d.items(),key=lambda x:x[0]) d
n,m=map(int,input().split())
d={};price=0
for _ in range(n):
  a,b=map(int,input().split())
  if a not in d:
    d[a] = b
  else:
    d[a] += b
d=sorted(d.items(),key=lambda x:x[0])
for i in d:
  for _ in range(i[1]):
    if m == 0:
      print(price)
      exit()
    m-=1
    price+=i[0]
else:
  print(price)