d = gets.to_i a, b = gets.split.map(&:to_i) x = 0 if (a < b) then x = d end p a * x + b * (d - x)