def r;gets.split.map &:to_i;end
N,M = r
S = N.times.map{r}
S.sort_by!{|v|v[0]}

count = M
money = 0
S.each do |(a,b)|
  if b < count
    count -= b
    money += b * a
  else
    money += count * a
    puts money
    exit
  end
end