n,m=map(int,input().split())
ab=[list(map(int,input().split())) for _ in range(n)]
ab.sort(key=lambda x: x[0])
ans=0
for a,b in ab:
  if m>=b:
    m-=b
    ans+=b*a
  else:
    ans+=a*m
    break
print(ans) 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(key=lambda x: x[0]) ab.sort ab sort key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x ans=0 ans 0 for a,b in ab:
  if m>=b:
    m-=b
    ans+=b*a
  else:
    ans+=a*m
    break a b ab if m>=b:
    m-=b
    ans+=b*a
  else:
    ans+=a*m
    break m>=b m b m-=b m b ans+=b*a ans b*a b a ans+=a*m ans a*m a m break print(ans) print ans m-=b b m 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 ans=0 0 ans ans+=a*m a*m ans n,m=map(int,input().split()) map(int,input().split()) n ans+=b*a b*a ans
n,m=map(int,input().split())
ab=[list(map(int,input().split())) for _ in range(n)]
ab.sort(key=lambda x: x[0])
ans=0
for a,b in ab:
  if m>=b:
    m-=b
    ans+=b*a
  else:
    ans+=a*m
    break
print(ans)
