d = read_line.to_i a, b = read_line.split.map(&.to_i) puts (0..d).min_of { |x| a * x + (d - x) * b }