defmodule Main do def main do d = IO.read(:line) |> String.trim |> String.to_integer; [a, b] = IO.read(:line) |> String.trim |> String.split(" ") |> Enum.map(&String.to_integer/1) x_list = Enum.to_list(0..d+1); ans = x_list |> Enum.map &(&1 * a + (d - &1) * b); Enum.max(ans) |> IO.puts; end end