n, m=map(int, input().split())
l=[]
for i in range(n):
  l.append(list(map(int, input().split())))
l = sorted(l, reverse=False)  
#print(l)
drinks=0
ttl=0
add=0
for i in range(n):
  add=min(m-drinks, l[i][1])
  ttl=ttl+add*l[i][0]
  drinks+=add
  if drinks==m:
    print(ttl)
    exit() n, m=map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m l=[] l [] for i in range(n):
  l.append(list(map(int, input().split()))) i range(n) range n l.append(list(map(int, input().split()))) l.append l append list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split l = sorted(l, reverse=False) l sorted(l, reverse=False) sorted l reverse=False reverse False drinks=0 drinks 0 ttl=0 ttl 0 add=0 add 0 for i in range(n):
  add=min(m-drinks, l[i][1])
  ttl=ttl+add*l[i][0]
  drinks+=add
  if drinks==m:
    print(ttl)
    exit() i range(n) range n add=min(m-drinks, l[i][1]) add min(m-drinks, l[i][1]) min m-drinks m drinks l[i][1] [i] l i 1 ttl=ttl+add*l[i][0] ttl ttl+add*l[i][0] ttl add*l[i][0] add l[i][0] [i] l i 0 drinks+=add drinks add if drinks==m:
    print(ttl)
    exit() drinks==m drinks m print(ttl) print ttl exit() exit add=0 0 add l=[] [] l l = sorted(l, reverse=False) sorted(l, reverse=False) l m=map(int, input().split()) map(int, input().split()) m ttl=ttl+add*l[i][0] ttl+add*l[i][0] ttl n, m=map(int, input().split()) map(int, input().split()) n drinks=0 0 drinks add=min(m-drinks, l[i][1]) min(m-drinks, l[i][1]) add drinks+=add add drinks ttl=0 0 ttl
n, m=map(int, input().split())
l=[]
for i in range(n):
  l.append(list(map(int, input().split())))
l = sorted(l, reverse=False)  
#print(l)
drinks=0
ttl=0
add=0
for i in range(n):
  add=min(m-drinks, l[i][1])
  ttl=ttl+add*l[i][0]
  drinks+=add
  if drinks==m:
    print(ttl)
    exit()
