(N, M), *ABs = readlines.map{|l| l.split.map(&:to_i)}

@abs = ABs.sort_by{|a, b| a}

def go(m, x, i)
  a, b = @abs[i]
  return x + a*(M - m) if m + b >= M
  go(m + b, x + a*b, i + 1)
end

puts go(0, 0, 0)