n,m=gets.split.map &:to_i
d,cash=[],0;n.times{d<< gets.split.map(&:to_i)}
d.sort_by!{|a,b|a}
n.times{|t|
  if (tmp=m-=d[t][1])<0
    cash+=(d[t][1]+tmp)*d[t][0]
    break
  else
    cash+=d[t].inject(:*)
  end
}
p cash